createWirelessGateway method

Future<CreateWirelessGatewayResponse> createWirelessGateway({
  1. required LoRaWANGateway loRaWAN,
  2. String? clientRequestToken,
  3. String? description,
  4. String? name,
  5. List<Tag>? tags,
})

Provisions a wireless gateway.

  • If you specify a GatewayEui value that already exists.
  • If you used a ClientRequestToken with the same parameters within the last 10 minutes.
To avoid this error, make sure that you use unique identifiers and parameters for each request within the specified time period.

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

Parameter loRaWAN : The gateway configuration information to use to create the wireless gateway.

Parameter clientRequestToken : Each resource must have a unique client request token. The client token is used to implement idempotency. It ensures that the request completes no more than one time. If you retry a request with the same token and the same parameters, the request will complete successfully. However, if you try to create a new resource using the same token but different parameters, an HTTP 409 conflict occurs. If you omit this value, AWS SDKs will automatically generate a unique client request. For more information about idempotency, see Ensuring idempotency in Amazon EC2 API requests.

Parameter description : The description of the new resource.

Parameter name : The name of the new resource.

Parameter tags : The tags to attach to the new wireless gateway. Tags are metadata that you can use to manage a resource.

Implementation

Future<CreateWirelessGatewayResponse> createWirelessGateway({
  required LoRaWANGateway loRaWAN,
  String? clientRequestToken,
  String? description,
  String? name,
  List<Tag>? tags,
}) async {
  final $payload = <String, dynamic>{
    'LoRaWAN': loRaWAN,
    'ClientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'Description': description,
    if (name != null) 'Name': name,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/wireless-gateways',
    exceptionFnMap: _exceptionFns,
  );
  return CreateWirelessGatewayResponse.fromJson(response);
}