associateLink method

Future<AssociateLinkResponse> associateLink({
  1. required String deviceId,
  2. required String globalNetworkId,
  3. required String linkId,
})

Associates a link to a device. A device can be associated to multiple links and a link can be associated to multiple devices. The device and link must be in the same global network and the same site.

May throw ValidationException. May throw ServiceQuotaExceededException. May throw AccessDeniedException. May throw ResourceNotFoundException. May throw ConflictException. May throw ThrottlingException. May throw InternalServerException.

Parameter deviceId : The ID of the device.

Parameter globalNetworkId : The ID of the global network.

Parameter linkId : The ID of the link.

Implementation

Future<AssociateLinkResponse> associateLink({
  required String deviceId,
  required String globalNetworkId,
  required String linkId,
}) async {
  ArgumentError.checkNotNull(deviceId, 'deviceId');
  ArgumentError.checkNotNull(globalNetworkId, 'globalNetworkId');
  ArgumentError.checkNotNull(linkId, 'linkId');
  final $payload = <String, dynamic>{
    'DeviceId': deviceId,
    'LinkId': linkId,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/global-networks/${Uri.encodeComponent(globalNetworkId)}/link-associations',
    exceptionFnMap: _exceptionFns,
  );
  return AssociateLinkResponse.fromJson(response);
}