A complex type that describes how CloudFront processes requests. You can create up to 10 cache behaviors.You must create at least as many cache behaviors (including the default cache behavior) as you have origins if you want CloudFront to distribute objects from all of the origins. Each cache behavior specifies the one origin from which you want CloudFront to get objects. If you have two origins and only the default cache behavior, the default cache behavior will cause CloudFront to get objects from one of the origins, but the other origin will never be used. If you don't want to specify any cache behaviors, include only an empty CacheBehaviors element. Don't include an empty CacheBehavior element, or CloudFront returns a MalformedXML error. To delete all cache behaviors in an existing distribution, update the distribution configuration and include only an empty CacheBehaviors element. To add, change, or remove one or more cache behaviors, update the distribution configuration and specify all of the cache behaviors that you want to include in the updated distribution.


	req, out := c.ListCloudFrontOriginAccessIdentitiesRequest(input)
	err := req.Send()
	return out, err

// ListCloudFrontOriginAccessIdentitiesPages iterates over the pages of a ListCloudFrontOriginAccessIdentities operation,
// calling the "fn" function with the response data for each page. To stop
// iterating, return false from the fn function.
// See ListCloudFrontOriginAccessIdentities method for more information on how to use this operation.
// Note: This operation can generate multiple requests to a service.
//    // Example iterating over at most 3 pages of a ListCloudFrontOriginAccessIdentities operation.
//    pageNum := 0
//    err := client.ListCloudFrontOriginAccessIdentitiesPages(params,
//        func(page *ListCloudFrontOriginAccessIdentitiesOutput, lastPage bool) bool {
//            pageNum++
//            fmt.Println(page)
//            return pageNum <= 3
//        })
func (c *CloudFront) ListCloudFrontOriginAccessIdentitiesPages(input *ListCloudFrontOriginAccessIdentitiesInput, fn func(p *ListCloudFrontOriginAccessIdentitiesOutput, lastPage bool) (shouldContinue bool)) error {
	page, _ := c.ListCloudFrontOriginAccessIdentitiesRequest(input)
	return page.EachPage(func(p interface{}, lastPage bool) bool {
		return fn(p.(*ListCloudFrontOriginAccessIdentitiesOutput), lastPage)

const opListDistributions = "ListDistributions2016_09_29"

// ListDistributionsRequest generates a "aws/request.Request" representing the
// client's request for the ListDistributions operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// See ListDistributions for usage and error information.
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the ListDistributions method directly
// instead.
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//    // Example sending a request using the ListDistributionsRequest method.
//    req, resp := client.ListDistributionsRequest(params)
//    err := req.Send()
//    if err == nil { // resp is now filled
//        fmt.Println(resp)
//    }
func (c *CloudFront) ListDistributionsRequest(input *ListDistributionsInput) (req *request.Request, output *ListDistributionsOutput) {
	op := &request.Operation{
		Name:       opListDistributions,
		HTTPMethod: "GET",
		HTTPPath:   "/2016-09-29/distribution",
		Paginator: &request.Paginator{
			InputTokens:     []string{"Marker"},
			OutputTokens:    []string{"DistributionList.NextMarker"},
			LimitToken:      "MaxItems",
			TruncationToken: "DistributionList.IsTruncated",

	if input == nil {
		input = &ListDistributionsInput{}

	req = c.newRequest(op, input, output)
	output = &ListDistributionsOutput{}
	req.Data = output

// ListDistributions API operation for Amazon CloudFront.
// List distributions.
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
// See the AWS API reference guide for Amazon CloudFront's
// API operation ListDistributions for usage and error information.
// Returned Error Codes:
//   * InvalidArgument
//   The argument is invalid.
func (c *CloudFront) ListDistributions(input *ListDistributionsInput) (*ListDistributionsOutput, error) {
	req, out := c.ListDistributionsRequest(input)
	err := req.Send()
	return out, err