createServiceNetworkResourceAssociation method

Future<CreateServiceNetworkResourceAssociationResponse> createServiceNetworkResourceAssociation({
  1. required String resourceConfigurationIdentifier,
  2. required String serviceNetworkIdentifier,
  3. String? clientToken,
  4. bool? privateDnsEnabled,
  5. Map<String, String>? tags,
})

Associates the specified service network with the specified resource configuration. This allows the resource configuration to receive connections through the service network, including through a service network VPC endpoint.

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

Parameter resourceConfigurationIdentifier : The ID of the resource configuration to associate with the service network.

Parameter serviceNetworkIdentifier : The ID of the service network to associate with the resource configuration.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client token and parameters, the retry succeeds without performing any actions. If the parameters aren't identical, the retry fails.

Parameter privateDnsEnabled : Indicates if private DNS is enabled for the service network resource association.

Parameter tags : A key-value pair to associate with a resource.

Implementation

Future<CreateServiceNetworkResourceAssociationResponse>
    createServiceNetworkResourceAssociation({
  required String resourceConfigurationIdentifier,
  required String serviceNetworkIdentifier,
  String? clientToken,
  bool? privateDnsEnabled,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'resourceConfigurationIdentifier': resourceConfigurationIdentifier,
    'serviceNetworkIdentifier': serviceNetworkIdentifier,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (privateDnsEnabled != null) 'privateDnsEnabled': privateDnsEnabled,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/servicenetworkresourceassociations',
    exceptionFnMap: _exceptionFns,
  );
  return CreateServiceNetworkResourceAssociationResponse.fromJson(response);
}