updateDistributionTenant method

Future<UpdateDistributionTenantResult> updateDistributionTenant({
  1. required String id,
  2. required String ifMatch,
  3. String? connectionGroupId,
  4. Customizations? customizations,
  5. String? distributionId,
  6. List<DomainItem>? domains,
  7. bool? enabled,
  8. ManagedCertificateRequest? managedCertificateRequest,
  9. List<Parameter>? parameters,
})

Updates a distribution tenant.

May throw AccessDenied. May throw CNAMEAlreadyExists. May throw EntityAlreadyExists. May throw EntityLimitExceeded. May throw EntityNotFound. May throw InvalidArgument. May throw InvalidAssociation. May throw InvalidIfMatchVersion. May throw PreconditionFailed.

Parameter id : The ID of the distribution tenant.

Parameter ifMatch : The value of the ETag header that you received when retrieving the distribution tenant to update. This value is returned in the response of the GetDistributionTenant API operation.

Parameter connectionGroupId : The ID of the target connection group.

Parameter customizations : Customizations for the distribution tenant. For each distribution tenant, you can specify the geographic restrictions, and the Amazon Resource Names (ARNs) for the ACM certificate and WAF web ACL. These are specific values that you can override or disable from the multi-tenant distribution that was used to create the distribution tenant.

Parameter distributionId : The ID for the multi-tenant distribution.

Parameter domains : The domains to update for the distribution tenant. A domain object can contain only a domain property. You must specify at least one domain. Each distribution tenant can have up to 5 domains.

Parameter enabled : Indicates whether the distribution tenant should be updated to an enabled state. If you update the distribution tenant and it's not enabled, the distribution tenant won't serve traffic.

Parameter managedCertificateRequest : An object that contains the CloudFront managed ACM certificate request.

Parameter parameters : A list of parameter values to add to the resource. A parameter is specified as a key-value pair. A valid parameter value must exist for any parameter that is marked as required in the multi-tenant distribution.

Implementation

Future<UpdateDistributionTenantResult> updateDistributionTenant({
  required String id,
  required String ifMatch,
  String? connectionGroupId,
  Customizations? customizations,
  String? distributionId,
  List<DomainItem>? domains,
  bool? enabled,
  ManagedCertificateRequest? managedCertificateRequest,
  List<Parameter>? parameters,
}) async {
  final headers = <String, String>{
    'If-Match': ifMatch.toString(),
  };
  final $result = await _protocol.sendRaw(
    method: 'PUT',
    requestUri: '/2020-05-31/distribution-tenant/${Uri.encodeComponent(id)}',
    headers: headers,
    payload: UpdateDistributionTenantRequest(
            id: id,
            ifMatch: ifMatch,
            connectionGroupId: connectionGroupId,
            customizations: customizations,
            distributionId: distributionId,
            domains: domains,
            enabled: enabled,
            managedCertificateRequest: managedCertificateRequest,
            parameters: parameters)
        .toXml('UpdateDistributionTenantRequest'),
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return UpdateDistributionTenantResult(
    distributionTenant: DistributionTenant.fromXml($elem),
    eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
  );
}