updateVpcOrigin method

Future<UpdateVpcOriginResult> updateVpcOrigin({
  1. required String id,
  2. required String ifMatch,
  3. required VpcOriginEndpointConfig vpcOriginEndpointConfig,
})

Update an Amazon CloudFront VPC origin in your account.

May throw AccessDenied. May throw CannotUpdateEntityWhileInUse. May throw EntityAlreadyExists. May throw EntityLimitExceeded. May throw EntityNotFound. May throw IllegalUpdate. May throw InconsistentQuantities. May throw InvalidArgument. May throw InvalidIfMatchVersion. May throw PreconditionFailed. May throw UnsupportedOperation.

Parameter id : The VPC origin ID.

Parameter ifMatch : The VPC origin to update, if a match occurs.

Parameter vpcOriginEndpointConfig : The VPC origin endpoint configuration.

Implementation

Future<UpdateVpcOriginResult> updateVpcOrigin({
  required String id,
  required String ifMatch,
  required VpcOriginEndpointConfig vpcOriginEndpointConfig,
}) async {
  final headers = <String, String>{
    'If-Match': ifMatch.toString(),
  };
  final $result = await _protocol.sendRaw(
    method: 'PUT',
    requestUri: '/2020-05-31/vpc-origin/${Uri.encodeComponent(id)}',
    headers: headers,
    payload: vpcOriginEndpointConfig.toXml('VpcOriginEndpointConfig'),
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return UpdateVpcOriginResult(
    vpcOrigin: VpcOrigin.fromXml($elem),
    eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
  );
}