createGateway method

Future<CreateGatewayResponse> createGateway({
  1. required List<String> egressCidrBlocks,
  2. required String name,
  3. required List<GatewayNetwork> networks,
})

Creates a new gateway. The request must include at least one network (up to four).

May throw BadRequestException. May throw ConflictException. May throw CreateGateway420Exception. May throw ForbiddenException. May throw InternalServerErrorException. May throw ServiceUnavailableException. May throw TooManyRequestsException.

Parameter egressCidrBlocks : The range of IP addresses that are allowed to contribute content or initiate output requests for flows communicating with this gateway. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.

Parameter name : The name of the gateway. This name can not be modified after the gateway is created.

Parameter networks : The list of networks that you want to add to the gateway.

Implementation

Future<CreateGatewayResponse> createGateway({
  required List<String> egressCidrBlocks,
  required String name,
  required List<GatewayNetwork> networks,
}) async {
  final $payload = <String, dynamic>{
    'egressCidrBlocks': egressCidrBlocks,
    'name': name,
    'networks': networks,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/gateways',
    exceptionFnMap: _exceptionFns,
  );
  return CreateGatewayResponse.fromJson(response);
}