updateSite method

Future<UpdateSiteResponse> updateSite({
  1. required String globalNetworkId,
  2. required String siteId,
  3. String? description,
  4. Location? location,
})

Updates the information for an existing site. To remove information for any of the parameters, specify an empty string.

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

Parameter globalNetworkId : The ID of the global network.

Parameter siteId : The ID of your site.

Parameter description : A description of your site.

Length Constraints: Maximum length of 256 characters.

Parameter location : The site location:

  • Address: The physical address of the site.
  • Latitude: The latitude of the site.
  • Longitude: The longitude of the site.

Implementation

Future<UpdateSiteResponse> updateSite({
  required String globalNetworkId,
  required String siteId,
  String? description,
  Location? location,
}) async {
  ArgumentError.checkNotNull(globalNetworkId, 'globalNetworkId');
  ArgumentError.checkNotNull(siteId, 'siteId');
  final $payload = <String, dynamic>{
    if (description != null) 'Description': description,
    if (location != null) 'Location': location,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/global-networks/${Uri.encodeComponent(globalNetworkId)}/sites/${Uri.encodeComponent(siteId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateSiteResponse.fromJson(response);
}