createVPCEConfiguration method

Future<CreateVPCEConfigurationResult> createVPCEConfiguration({
  1. required String serviceDnsName,
  2. required String vpceConfigurationName,
  3. required String vpceServiceName,
  4. String? vpceConfigurationDescription,
})

Creates a configuration record in Device Farm for your Amazon Virtual Private Cloud (VPC) endpoint.

May throw ArgumentException. May throw LimitExceededException. May throw ServiceAccountException.

Parameter serviceDnsName : The DNS name of the service running in your VPC that you want Device Farm to test.

Parameter vpceConfigurationName : The friendly name you give to your VPC endpoint configuration, to manage your configurations more easily.

Parameter vpceServiceName : The name of the VPC endpoint service running in your AWS account that you want Device Farm to test.

Parameter vpceConfigurationDescription : An optional description that provides details about your VPC endpoint configuration.

Implementation

Future<CreateVPCEConfigurationResult> createVPCEConfiguration({
  required String serviceDnsName,
  required String vpceConfigurationName,
  required String vpceServiceName,
  String? vpceConfigurationDescription,
}) async {
  ArgumentError.checkNotNull(serviceDnsName, 'serviceDnsName');
  _s.validateStringLength(
    'serviceDnsName',
    serviceDnsName,
    0,
    2048,
    isRequired: true,
  );
  ArgumentError.checkNotNull(vpceConfigurationName, 'vpceConfigurationName');
  _s.validateStringLength(
    'vpceConfigurationName',
    vpceConfigurationName,
    0,
    1024,
    isRequired: true,
  );
  ArgumentError.checkNotNull(vpceServiceName, 'vpceServiceName');
  _s.validateStringLength(
    'vpceServiceName',
    vpceServiceName,
    0,
    2048,
    isRequired: true,
  );
  _s.validateStringLength(
    'vpceConfigurationDescription',
    vpceConfigurationDescription,
    0,
    2048,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DeviceFarm_20150623.CreateVPCEConfiguration'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'serviceDnsName': serviceDnsName,
      'vpceConfigurationName': vpceConfigurationName,
      'vpceServiceName': vpceServiceName,
      if (vpceConfigurationDescription != null)
        'vpceConfigurationDescription': vpceConfigurationDescription,
    },
  );

  return CreateVPCEConfigurationResult.fromJson(jsonResponse.body);
}