listDistributionsByOwnedResource method

Future<ListDistributionsByOwnedResourceResult> listDistributionsByOwnedResource({
  1. required String resourceArn,
  2. String? marker,
  3. int? maxItems,
})

Lists the CloudFront distributions that are associated with the specified resource that you own.

May throw AccessDenied. May throw EntityNotFound. May throw InvalidArgument. May throw UnsupportedOperation.

Parameter resourceArn : The ARN of the CloudFront resource that you've shared with other Amazon Web Services accounts.

Parameter marker : Use this field when paginating results to indicate where to begin in your list of distributions. The response includes distributions in the list that occur after the marker. To get the next page of the list, set this field's value to the value of NextMarker from the current page's response.

Parameter maxItems : The maximum number of distributions to return.

Implementation

Future<ListDistributionsByOwnedResourceResult>
    listDistributionsByOwnedResource({
  required String resourceArn,
  String? marker,
  int? maxItems,
}) async {
  final $query = <String, List<String>>{
    if (marker != null) 'Marker': [marker],
    if (maxItems != null) 'MaxItems': [maxItems.toString()],
  };
  final $result = await _protocol.sendRaw(
    method: 'GET',
    requestUri:
        '/2020-05-31/distributionsByOwnedResource/${Uri.encodeComponent(resourceArn)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return ListDistributionsByOwnedResourceResult(
    distributionList: DistributionIdOwnerList.fromXml($elem),
  );
}