lib/aws-sdk-cloudfront/client.rb in aws-sdk-cloudfront-1.49.0 vs lib/aws-sdk-cloudfront/client.rb in aws-sdk-cloudfront-1.50.0

- old
+ new

@@ -614,10 +614,19 @@ # event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response # include_body: false, # }, # ], # }, + # function_associations: { + # quantity: 1, # required + # items: [ + # { + # function_arn: "FunctionARN", # required + # event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response + # }, + # ], + # }, # field_level_encryption_id: "string", # realtime_log_config_arn: "string", # cache_policy_id: "string", # origin_request_policy_id: "string", # forwarded_values: { @@ -677,10 +686,19 @@ # event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response # include_body: false, # }, # ], # }, + # function_associations: { + # quantity: 1, # required + # items: [ + # { + # function_arn: "FunctionARN", # required + # event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response + # }, + # ], + # }, # field_level_encryption_id: "string", # realtime_log_config_arn: "string", # cache_policy_id: "string", # origin_request_policy_id: "string", # forwarded_values: { @@ -828,10 +846,14 @@ # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.quantity #=> Integer # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items #=> Array # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].lambda_function_arn #=> String # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].include_body #=> Boolean + # resp.distribution.distribution_config.default_cache_behavior.function_associations.quantity #=> Integer + # resp.distribution.distribution_config.default_cache_behavior.function_associations.items #=> Array + # resp.distribution.distribution_config.default_cache_behavior.function_associations.items[0].function_arn #=> String + # resp.distribution.distribution_config.default_cache_behavior.function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution.distribution_config.default_cache_behavior.field_level_encryption_id #=> String # resp.distribution.distribution_config.default_cache_behavior.realtime_log_config_arn #=> String # resp.distribution.distribution_config.default_cache_behavior.cache_policy_id #=> String # resp.distribution.distribution_config.default_cache_behavior.origin_request_policy_id #=> String # resp.distribution.distribution_config.default_cache_behavior.forwarded_values.query_string #=> Boolean @@ -872,10 +894,14 @@ # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.quantity #=> Integer # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items #=> Array # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].lambda_function_arn #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].include_body #=> Boolean + # resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.quantity #=> Integer + # resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items #=> Array + # resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items[0].function_arn #=> String + # resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution.distribution_config.cache_behaviors.items[0].field_level_encryption_id #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].realtime_log_config_arn #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].cache_policy_id #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].origin_request_policy_id #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.query_string #=> Boolean @@ -1048,10 +1074,19 @@ # event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response # include_body: false, # }, # ], # }, + # function_associations: { + # quantity: 1, # required + # items: [ + # { + # function_arn: "FunctionARN", # required + # event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response + # }, + # ], + # }, # field_level_encryption_id: "string", # realtime_log_config_arn: "string", # cache_policy_id: "string", # origin_request_policy_id: "string", # forwarded_values: { @@ -1111,10 +1146,19 @@ # event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response # include_body: false, # }, # ], # }, + # function_associations: { + # quantity: 1, # required + # items: [ + # { + # function_arn: "FunctionARN", # required + # event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response + # }, + # ], + # }, # field_level_encryption_id: "string", # realtime_log_config_arn: "string", # cache_policy_id: "string", # origin_request_policy_id: "string", # forwarded_values: { @@ -1271,10 +1315,14 @@ # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.quantity #=> Integer # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items #=> Array # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].lambda_function_arn #=> String # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].include_body #=> Boolean + # resp.distribution.distribution_config.default_cache_behavior.function_associations.quantity #=> Integer + # resp.distribution.distribution_config.default_cache_behavior.function_associations.items #=> Array + # resp.distribution.distribution_config.default_cache_behavior.function_associations.items[0].function_arn #=> String + # resp.distribution.distribution_config.default_cache_behavior.function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution.distribution_config.default_cache_behavior.field_level_encryption_id #=> String # resp.distribution.distribution_config.default_cache_behavior.realtime_log_config_arn #=> String # resp.distribution.distribution_config.default_cache_behavior.cache_policy_id #=> String # resp.distribution.distribution_config.default_cache_behavior.origin_request_policy_id #=> String # resp.distribution.distribution_config.default_cache_behavior.forwarded_values.query_string #=> Boolean @@ -1315,10 +1363,14 @@ # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.quantity #=> Integer # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items #=> Array # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].lambda_function_arn #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].include_body #=> Boolean + # resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.quantity #=> Integer + # resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items #=> Array + # resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items[0].function_arn #=> String + # resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution.distribution_config.cache_behaviors.items[0].field_level_encryption_id #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].realtime_log_config_arn #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].cache_policy_id #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].origin_request_policy_id #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.query_string #=> Boolean @@ -1509,10 +1561,80 @@ def create_field_level_encryption_profile(params = {}, options = {}) req = build_request(:create_field_level_encryption_profile, params) req.send_request(options) end + # Creates a CloudFront function. + # + # To create a function, you provide the function code and some + # configuration information about the function. The response contains an + # Amazon Resource Name (ARN) that uniquely identifies the function. + # + # When you create a function, it’s in the `DEVELOPMENT` stage. In this + # stage, you can test the function with `TestFunction`, and update it + # with `UpdateFunction`. + # + # When you’re ready to use your function with a CloudFront distribution, + # use `PublishFunction` to copy the function from the `DEVELOPMENT` + # stage to `LIVE`. When it’s live, you can attach the function to a + # distribution’s cache behavior, using the function’s ARN. + # + # @option params [required, String] :name + # A name to identify the function. + # + # @option params [required, Types::FunctionConfig] :function_config + # Configuration information about the function, including an optional + # comment and the function’s runtime. + # + # @option params [required, String, StringIO, File] :function_code + # The function code. For more information about writing a CloudFront + # function, see [Writing function code for CloudFront Functions][1] in + # the *Amazon CloudFront Developer Guide*. + # + # + # + # [1]: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/writing-function-code.html + # + # @return [Types::CreateFunctionResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods: + # + # * {Types::CreateFunctionResult#function_summary #function_summary} => Types::FunctionSummary + # * {Types::CreateFunctionResult#location #location} => String + # * {Types::CreateFunctionResult#etag #etag} => String + # + # @example Request syntax with placeholder values + # + # resp = client.create_function({ + # name: "FunctionName", # required + # function_config: { # required + # comment: "string", # required + # runtime: "cloudfront-js-1.0", # required, accepts cloudfront-js-1.0 + # }, + # function_code: "data", # required + # }) + # + # @example Response structure + # + # resp.function_summary.name #=> String + # resp.function_summary.status #=> String + # resp.function_summary.function_config.comment #=> String + # resp.function_summary.function_config.runtime #=> String, one of "cloudfront-js-1.0" + # resp.function_summary.function_metadata.function_arn #=> String + # resp.function_summary.function_metadata.stage #=> String, one of "DEVELOPMENT", "LIVE" + # resp.function_summary.function_metadata.created_time #=> Time + # resp.function_summary.function_metadata.last_modified_time #=> Time + # resp.location #=> String + # resp.etag #=> String + # + # @see http://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/CreateFunction2020_05_31 AWS API Documentation + # + # @overload create_function(params = {}) + # @param [Hash] params ({}) + def create_function(params = {}, options = {}) + req = build_request(:create_function, params) + req.send_request(options) + end + # Create a new invalidation. # # @option params [required, String] :distribution_id # The distribution's id. # @@ -2216,10 +2338,45 @@ def delete_field_level_encryption_profile(params = {}, options = {}) req = build_request(:delete_field_level_encryption_profile, params) req.send_request(options) end + # Deletes a CloudFront function. + # + # You cannot delete a function if it’s associated with a cache behavior. + # First, update your distributions to remove the function association + # from all cache behaviors, then delete the function. + # + # To delete a function, you must provide the function’s name and version + # (`ETag` value). To get these values, you can use `ListFunctions` and + # `DescribeFunction`. + # + # @option params [required, String] :name + # The name of the function that you are deleting. + # + # @option params [required, String] :if_match + # The current version (`ETag` value) of the function that you are + # deleting, which you can get using `DescribeFunction`. + # + # @return [Struct] Returns an empty {Seahorse::Client::Response response}. + # + # @example Request syntax with placeholder values + # + # resp = client.delete_function({ + # name: "string", # required + # if_match: "string", # required + # }) + # + # @see http://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/DeleteFunction2020_05_31 AWS API Documentation + # + # @overload delete_function(params = {}) + # @param [Hash] params ({}) + def delete_function(params = {}, options = {}) + req = build_request(:delete_function, params) + req.send_request(options) + end + # Deletes a key group. # # You cannot delete a key group that is referenced in a cache behavior. # First update your distributions to remove the key group from all cache # behaviors, then delete the key group. @@ -2450,10 +2607,57 @@ def delete_streaming_distribution(params = {}, options = {}) req = build_request(:delete_streaming_distribution, params) req.send_request(options) end + # Gets configuration information and metadata about a CloudFront + # function, but not the function’s code. To get a function’s code, use + # `GetFunction`. + # + # To get configuration information and metadata about a function, you + # must provide the function’s name and stage. To get these values, you + # can use `ListFunctions`. + # + # @option params [required, String] :name + # The name of the function that you are getting information about. + # + # @option params [String] :stage + # The function’s stage, either `DEVELOPMENT` or `LIVE`. + # + # @return [Types::DescribeFunctionResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods: + # + # * {Types::DescribeFunctionResult#function_summary #function_summary} => Types::FunctionSummary + # * {Types::DescribeFunctionResult#etag #etag} => String + # + # @example Request syntax with placeholder values + # + # resp = client.describe_function({ + # name: "string", # required + # stage: "DEVELOPMENT", # accepts DEVELOPMENT, LIVE + # }) + # + # @example Response structure + # + # resp.function_summary.name #=> String + # resp.function_summary.status #=> String + # resp.function_summary.function_config.comment #=> String + # resp.function_summary.function_config.runtime #=> String, one of "cloudfront-js-1.0" + # resp.function_summary.function_metadata.function_arn #=> String + # resp.function_summary.function_metadata.stage #=> String, one of "DEVELOPMENT", "LIVE" + # resp.function_summary.function_metadata.created_time #=> Time + # resp.function_summary.function_metadata.last_modified_time #=> Time + # resp.etag #=> String + # + # @see http://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/DescribeFunction2020_05_31 AWS API Documentation + # + # @overload describe_function(params = {}) + # @param [Hash] params ({}) + def describe_function(params = {}, options = {}) + req = build_request(:describe_function, params) + req.send_request(options) + end + # Gets a cache policy, including the following metadata: # # * The policy’s identifier. # # * The date and time when the policy was last modified. @@ -2735,10 +2939,14 @@ # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.quantity #=> Integer # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items #=> Array # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].lambda_function_arn #=> String # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].include_body #=> Boolean + # resp.distribution.distribution_config.default_cache_behavior.function_associations.quantity #=> Integer + # resp.distribution.distribution_config.default_cache_behavior.function_associations.items #=> Array + # resp.distribution.distribution_config.default_cache_behavior.function_associations.items[0].function_arn #=> String + # resp.distribution.distribution_config.default_cache_behavior.function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution.distribution_config.default_cache_behavior.field_level_encryption_id #=> String # resp.distribution.distribution_config.default_cache_behavior.realtime_log_config_arn #=> String # resp.distribution.distribution_config.default_cache_behavior.cache_policy_id #=> String # resp.distribution.distribution_config.default_cache_behavior.origin_request_policy_id #=> String # resp.distribution.distribution_config.default_cache_behavior.forwarded_values.query_string #=> Boolean @@ -2779,10 +2987,14 @@ # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.quantity #=> Integer # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items #=> Array # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].lambda_function_arn #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].include_body #=> Boolean + # resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.quantity #=> Integer + # resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items #=> Array + # resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items[0].function_arn #=> String + # resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution.distribution_config.cache_behaviors.items[0].field_level_encryption_id #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].realtime_log_config_arn #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].cache_policy_id #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].origin_request_policy_id #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.query_string #=> Boolean @@ -2921,10 +3133,14 @@ # resp.distribution_config.default_cache_behavior.lambda_function_associations.quantity #=> Integer # resp.distribution_config.default_cache_behavior.lambda_function_associations.items #=> Array # resp.distribution_config.default_cache_behavior.lambda_function_associations.items[0].lambda_function_arn #=> String # resp.distribution_config.default_cache_behavior.lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution_config.default_cache_behavior.lambda_function_associations.items[0].include_body #=> Boolean + # resp.distribution_config.default_cache_behavior.function_associations.quantity #=> Integer + # resp.distribution_config.default_cache_behavior.function_associations.items #=> Array + # resp.distribution_config.default_cache_behavior.function_associations.items[0].function_arn #=> String + # resp.distribution_config.default_cache_behavior.function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution_config.default_cache_behavior.field_level_encryption_id #=> String # resp.distribution_config.default_cache_behavior.realtime_log_config_arn #=> String # resp.distribution_config.default_cache_behavior.cache_policy_id #=> String # resp.distribution_config.default_cache_behavior.origin_request_policy_id #=> String # resp.distribution_config.default_cache_behavior.forwarded_values.query_string #=> Boolean @@ -2965,10 +3181,14 @@ # resp.distribution_config.cache_behaviors.items[0].lambda_function_associations.quantity #=> Integer # resp.distribution_config.cache_behaviors.items[0].lambda_function_associations.items #=> Array # resp.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].lambda_function_arn #=> String # resp.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].include_body #=> Boolean + # resp.distribution_config.cache_behaviors.items[0].function_associations.quantity #=> Integer + # resp.distribution_config.cache_behaviors.items[0].function_associations.items #=> Array + # resp.distribution_config.cache_behaviors.items[0].function_associations.items[0].function_arn #=> String + # resp.distribution_config.cache_behaviors.items[0].function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution_config.cache_behaviors.items[0].field_level_encryption_id #=> String # resp.distribution_config.cache_behaviors.items[0].realtime_log_config_arn #=> String # resp.distribution_config.cache_behaviors.items[0].cache_policy_id #=> String # resp.distribution_config.cache_behaviors.items[0].origin_request_policy_id #=> String # resp.distribution_config.cache_behaviors.items[0].forwarded_values.query_string #=> Boolean @@ -3190,10 +3410,50 @@ def get_field_level_encryption_profile_config(params = {}, options = {}) req = build_request(:get_field_level_encryption_profile_config, params) req.send_request(options) end + # Gets the code of a CloudFront function. To get configuration + # information and metadata about a function, use `DescribeFunction`. + # + # To get a function’s code, you must provide the function’s name and + # stage. To get these values, you can use `ListFunctions`. + # + # @option params [required, String] :name + # The name of the function whose code you are getting. + # + # @option params [String] :stage + # The function’s stage, either `DEVELOPMENT` or `LIVE`. + # + # @return [Types::GetFunctionResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods: + # + # * {Types::GetFunctionResult#function_code #function_code} => String + # * {Types::GetFunctionResult#etag #etag} => String + # * {Types::GetFunctionResult#content_type #content_type} => String + # + # @example Request syntax with placeholder values + # + # resp = client.get_function({ + # name: "string", # required + # stage: "DEVELOPMENT", # accepts DEVELOPMENT, LIVE + # }) + # + # @example Response structure + # + # resp.function_code #=> String + # resp.etag #=> String + # resp.content_type #=> String + # + # @see http://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/GetFunction2020_05_31 AWS API Documentation + # + # @overload get_function(params = {}) + # @param [Hash] params ({}) + def get_function(params = {}, options = {}) + req = build_request(:get_function, params) + req.send_request(options) + end + # Get the information about an invalidation. # # @option params [required, String] :distribution_id # The distribution's ID. # @@ -3911,10 +4171,14 @@ # resp.distribution_list.items[0].default_cache_behavior.lambda_function_associations.quantity #=> Integer # resp.distribution_list.items[0].default_cache_behavior.lambda_function_associations.items #=> Array # resp.distribution_list.items[0].default_cache_behavior.lambda_function_associations.items[0].lambda_function_arn #=> String # resp.distribution_list.items[0].default_cache_behavior.lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution_list.items[0].default_cache_behavior.lambda_function_associations.items[0].include_body #=> Boolean + # resp.distribution_list.items[0].default_cache_behavior.function_associations.quantity #=> Integer + # resp.distribution_list.items[0].default_cache_behavior.function_associations.items #=> Array + # resp.distribution_list.items[0].default_cache_behavior.function_associations.items[0].function_arn #=> String + # resp.distribution_list.items[0].default_cache_behavior.function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution_list.items[0].default_cache_behavior.field_level_encryption_id #=> String # resp.distribution_list.items[0].default_cache_behavior.realtime_log_config_arn #=> String # resp.distribution_list.items[0].default_cache_behavior.cache_policy_id #=> String # resp.distribution_list.items[0].default_cache_behavior.origin_request_policy_id #=> String # resp.distribution_list.items[0].default_cache_behavior.forwarded_values.query_string #=> Boolean @@ -3955,10 +4219,14 @@ # resp.distribution_list.items[0].cache_behaviors.items[0].lambda_function_associations.quantity #=> Integer # resp.distribution_list.items[0].cache_behaviors.items[0].lambda_function_associations.items #=> Array # resp.distribution_list.items[0].cache_behaviors.items[0].lambda_function_associations.items[0].lambda_function_arn #=> String # resp.distribution_list.items[0].cache_behaviors.items[0].lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution_list.items[0].cache_behaviors.items[0].lambda_function_associations.items[0].include_body #=> Boolean + # resp.distribution_list.items[0].cache_behaviors.items[0].function_associations.quantity #=> Integer + # resp.distribution_list.items[0].cache_behaviors.items[0].function_associations.items #=> Array + # resp.distribution_list.items[0].cache_behaviors.items[0].function_associations.items[0].function_arn #=> String + # resp.distribution_list.items[0].cache_behaviors.items[0].function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution_list.items[0].cache_behaviors.items[0].field_level_encryption_id #=> String # resp.distribution_list.items[0].cache_behaviors.items[0].realtime_log_config_arn #=> String # resp.distribution_list.items[0].cache_behaviors.items[0].cache_policy_id #=> String # resp.distribution_list.items[0].cache_behaviors.items[0].origin_request_policy_id #=> String # resp.distribution_list.items[0].cache_behaviors.items[0].forwarded_values.query_string #=> Boolean @@ -4290,10 +4558,14 @@ # resp.distribution_list.items[0].default_cache_behavior.lambda_function_associations.quantity #=> Integer # resp.distribution_list.items[0].default_cache_behavior.lambda_function_associations.items #=> Array # resp.distribution_list.items[0].default_cache_behavior.lambda_function_associations.items[0].lambda_function_arn #=> String # resp.distribution_list.items[0].default_cache_behavior.lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution_list.items[0].default_cache_behavior.lambda_function_associations.items[0].include_body #=> Boolean + # resp.distribution_list.items[0].default_cache_behavior.function_associations.quantity #=> Integer + # resp.distribution_list.items[0].default_cache_behavior.function_associations.items #=> Array + # resp.distribution_list.items[0].default_cache_behavior.function_associations.items[0].function_arn #=> String + # resp.distribution_list.items[0].default_cache_behavior.function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution_list.items[0].default_cache_behavior.field_level_encryption_id #=> String # resp.distribution_list.items[0].default_cache_behavior.realtime_log_config_arn #=> String # resp.distribution_list.items[0].default_cache_behavior.cache_policy_id #=> String # resp.distribution_list.items[0].default_cache_behavior.origin_request_policy_id #=> String # resp.distribution_list.items[0].default_cache_behavior.forwarded_values.query_string #=> Boolean @@ -4334,10 +4606,14 @@ # resp.distribution_list.items[0].cache_behaviors.items[0].lambda_function_associations.quantity #=> Integer # resp.distribution_list.items[0].cache_behaviors.items[0].lambda_function_associations.items #=> Array # resp.distribution_list.items[0].cache_behaviors.items[0].lambda_function_associations.items[0].lambda_function_arn #=> String # resp.distribution_list.items[0].cache_behaviors.items[0].lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution_list.items[0].cache_behaviors.items[0].lambda_function_associations.items[0].include_body #=> Boolean + # resp.distribution_list.items[0].cache_behaviors.items[0].function_associations.quantity #=> Integer + # resp.distribution_list.items[0].cache_behaviors.items[0].function_associations.items #=> Array + # resp.distribution_list.items[0].cache_behaviors.items[0].function_associations.items[0].function_arn #=> String + # resp.distribution_list.items[0].cache_behaviors.items[0].function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution_list.items[0].cache_behaviors.items[0].field_level_encryption_id #=> String # resp.distribution_list.items[0].cache_behaviors.items[0].realtime_log_config_arn #=> String # resp.distribution_list.items[0].cache_behaviors.items[0].cache_policy_id #=> String # resp.distribution_list.items[0].cache_behaviors.items[0].origin_request_policy_id #=> String # resp.distribution_list.items[0].cache_behaviors.items[0].forwarded_values.query_string #=> Boolean @@ -4490,10 +4766,14 @@ # resp.distribution_list.items[0].default_cache_behavior.lambda_function_associations.quantity #=> Integer # resp.distribution_list.items[0].default_cache_behavior.lambda_function_associations.items #=> Array # resp.distribution_list.items[0].default_cache_behavior.lambda_function_associations.items[0].lambda_function_arn #=> String # resp.distribution_list.items[0].default_cache_behavior.lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution_list.items[0].default_cache_behavior.lambda_function_associations.items[0].include_body #=> Boolean + # resp.distribution_list.items[0].default_cache_behavior.function_associations.quantity #=> Integer + # resp.distribution_list.items[0].default_cache_behavior.function_associations.items #=> Array + # resp.distribution_list.items[0].default_cache_behavior.function_associations.items[0].function_arn #=> String + # resp.distribution_list.items[0].default_cache_behavior.function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution_list.items[0].default_cache_behavior.field_level_encryption_id #=> String # resp.distribution_list.items[0].default_cache_behavior.realtime_log_config_arn #=> String # resp.distribution_list.items[0].default_cache_behavior.cache_policy_id #=> String # resp.distribution_list.items[0].default_cache_behavior.origin_request_policy_id #=> String # resp.distribution_list.items[0].default_cache_behavior.forwarded_values.query_string #=> Boolean @@ -4534,10 +4814,14 @@ # resp.distribution_list.items[0].cache_behaviors.items[0].lambda_function_associations.quantity #=> Integer # resp.distribution_list.items[0].cache_behaviors.items[0].lambda_function_associations.items #=> Array # resp.distribution_list.items[0].cache_behaviors.items[0].lambda_function_associations.items[0].lambda_function_arn #=> String # resp.distribution_list.items[0].cache_behaviors.items[0].lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution_list.items[0].cache_behaviors.items[0].lambda_function_associations.items[0].include_body #=> Boolean + # resp.distribution_list.items[0].cache_behaviors.items[0].function_associations.quantity #=> Integer + # resp.distribution_list.items[0].cache_behaviors.items[0].function_associations.items #=> Array + # resp.distribution_list.items[0].cache_behaviors.items[0].function_associations.items[0].function_arn #=> String + # resp.distribution_list.items[0].cache_behaviors.items[0].function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution_list.items[0].cache_behaviors.items[0].field_level_encryption_id #=> String # resp.distribution_list.items[0].cache_behaviors.items[0].realtime_log_config_arn #=> String # resp.distribution_list.items[0].cache_behaviors.items[0].cache_policy_id #=> String # resp.distribution_list.items[0].cache_behaviors.items[0].origin_request_policy_id #=> String # resp.distribution_list.items[0].cache_behaviors.items[0].forwarded_values.query_string #=> Boolean @@ -4696,10 +4980,72 @@ def list_field_level_encryption_profiles(params = {}, options = {}) req = build_request(:list_field_level_encryption_profiles, params) req.send_request(options) end + # Gets a list of all CloudFront functions in your AWS account. + # + # You can optionally apply a filter to return only the functions that + # are in the specified stage, either `DEVELOPMENT` or `LIVE`. + # + # You can optionally specify the maximum number of items to receive in + # the response. If the total number of items in the list exceeds the + # maximum that you specify, or the default maximum, the response is + # paginated. To get the next page of items, send a subsequent request + # that specifies the `NextMarker` value from the current response as the + # `Marker` value in the subsequent request. + # + # @option params [String] :marker + # Use this field when paginating results to indicate where to begin in + # your list of functions. The response includes functions 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. + # + # @option params [Integer] :max_items + # The maximum number of functions that you want in the response. + # + # @option params [String] :stage + # An optional filter to return only the functions that are in the + # specified stage, either `DEVELOPMENT` or `LIVE`. + # + # @return [Types::ListFunctionsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods: + # + # * {Types::ListFunctionsResult#function_list #function_list} => Types::FunctionList + # + # @example Request syntax with placeholder values + # + # resp = client.list_functions({ + # marker: "string", + # max_items: 1, + # stage: "DEVELOPMENT", # accepts DEVELOPMENT, LIVE + # }) + # + # @example Response structure + # + # resp.function_list.next_marker #=> String + # resp.function_list.max_items #=> Integer + # resp.function_list.quantity #=> Integer + # resp.function_list.items #=> Array + # resp.function_list.items[0].name #=> String + # resp.function_list.items[0].status #=> String + # resp.function_list.items[0].function_config.comment #=> String + # resp.function_list.items[0].function_config.runtime #=> String, one of "cloudfront-js-1.0" + # resp.function_list.items[0].function_metadata.function_arn #=> String + # resp.function_list.items[0].function_metadata.stage #=> String, one of "DEVELOPMENT", "LIVE" + # resp.function_list.items[0].function_metadata.created_time #=> Time + # resp.function_list.items[0].function_metadata.last_modified_time #=> Time + # + # @see http://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/ListFunctions2020_05_31 AWS API Documentation + # + # @overload list_functions(params = {}) + # @param [Hash] params ({}) + def list_functions(params = {}, options = {}) + req = build_request(:list_functions, params) + req.send_request(options) + end + # Lists invalidation batches. # # @option params [required, String] :distribution_id # The distribution's ID. # @@ -5068,10 +5414,61 @@ def list_tags_for_resource(params = {}, options = {}) req = build_request(:list_tags_for_resource, params) req.send_request(options) end + # Publishes a CloudFront function by copying the function code from the + # `DEVELOPMENT` stage to `LIVE`. This automatically updates all cache + # behaviors that are using this function to use the newly published copy + # in the `LIVE` stage. + # + # When a function is published to the `LIVE` stage, you can attach the + # function to a distribution’s cache behavior, using the function’s + # Amazon Resource Name (ARN). + # + # To publish a function, you must provide the function’s name and + # version (`ETag` value). To get these values, you can use + # `ListFunctions` and `DescribeFunction`. + # + # @option params [required, String] :name + # The name of the function that you are publishing. + # + # @option params [required, String] :if_match + # The current version (`ETag` value) of the function that you are + # publishing, which you can get using `DescribeFunction`. + # + # @return [Types::PublishFunctionResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods: + # + # * {Types::PublishFunctionResult#function_summary #function_summary} => Types::FunctionSummary + # + # @example Request syntax with placeholder values + # + # resp = client.publish_function({ + # name: "string", # required + # if_match: "string", # required + # }) + # + # @example Response structure + # + # resp.function_summary.name #=> String + # resp.function_summary.status #=> String + # resp.function_summary.function_config.comment #=> String + # resp.function_summary.function_config.runtime #=> String, one of "cloudfront-js-1.0" + # resp.function_summary.function_metadata.function_arn #=> String + # resp.function_summary.function_metadata.stage #=> String, one of "DEVELOPMENT", "LIVE" + # resp.function_summary.function_metadata.created_time #=> Time + # resp.function_summary.function_metadata.last_modified_time #=> Time + # + # @see http://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/PublishFunction2020_05_31 AWS API Documentation + # + # @overload publish_function(params = {}) + # @param [Hash] params ({}) + def publish_function(params = {}, options = {}) + req = build_request(:publish_function, params) + req.send_request(options) + end + # Add tags to a CloudFront resource. # # @option params [required, String] :resource # An ARN of a CloudFront resource. # @@ -5101,10 +5498,87 @@ def tag_resource(params = {}, options = {}) req = build_request(:tag_resource, params) req.send_request(options) end + # Tests a CloudFront function. + # + # To test a function, you provide an *event object* that represents an + # HTTP request or response that your CloudFront distribution could + # receive in production. CloudFront runs the function, passing it the + # event object that you provided, and returns the function’s result (the + # modified event object) in the response. The response also contains + # function logs and error messages, if any exist. For more information + # about testing functions, see [Testing functions][1] in the *Amazon + # CloudFront Developer Guide*. + # + # To test a function, you provide the function’s name and version + # (`ETag` value) along with the event object. To get the function’s name + # and version, you can use `ListFunctions` and `DescribeFunction`. + # + # + # + # [1]: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/managing-functions.html#test-function + # + # @option params [required, String] :name + # The name of the function that you are testing. + # + # @option params [required, String] :if_match + # The current version (`ETag` value) of the function that you are + # testing, which you can get using `DescribeFunction`. + # + # @option params [String] :stage + # The stage of the function that you are testing, either `DEVELOPMENT` + # or `LIVE`. + # + # @option params [required, String, StringIO, File] :event_object + # The event object to test the function with. For more information about + # the structure of the event object, see [Testing functions][1] in the + # *Amazon CloudFront Developer Guide*. + # + # + # + # [1]: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/managing-functions.html#test-function + # + # @return [Types::TestFunctionResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods: + # + # * {Types::TestFunctionResult#test_result #test_result} => Types::TestResult + # + # @example Request syntax with placeholder values + # + # resp = client.test_function({ + # name: "string", # required + # if_match: "string", # required + # stage: "DEVELOPMENT", # accepts DEVELOPMENT, LIVE + # event_object: "data", # required + # }) + # + # @example Response structure + # + # resp.test_result.function_summary.name #=> String + # resp.test_result.function_summary.status #=> String + # resp.test_result.function_summary.function_config.comment #=> String + # resp.test_result.function_summary.function_config.runtime #=> String, one of "cloudfront-js-1.0" + # resp.test_result.function_summary.function_metadata.function_arn #=> String + # resp.test_result.function_summary.function_metadata.stage #=> String, one of "DEVELOPMENT", "LIVE" + # resp.test_result.function_summary.function_metadata.created_time #=> Time + # resp.test_result.function_summary.function_metadata.last_modified_time #=> Time + # resp.test_result.compute_utilization #=> String + # resp.test_result.function_execution_logs #=> Array + # resp.test_result.function_execution_logs[0] #=> String + # resp.test_result.function_error_message #=> String + # resp.test_result.function_output #=> String + # + # @see http://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/TestFunction2020_05_31 AWS API Documentation + # + # @overload test_function(params = {}) + # @param [Hash] params ({}) + def test_function(params = {}, options = {}) + req = build_request(:test_function, params) + req.send_request(options) + end + # Remove tags from a CloudFront resource. # # @option params [required, String] :resource # An ARN of a CloudFront resource. # @@ -5477,10 +5951,19 @@ # event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response # include_body: false, # }, # ], # }, + # function_associations: { + # quantity: 1, # required + # items: [ + # { + # function_arn: "FunctionARN", # required + # event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response + # }, + # ], + # }, # field_level_encryption_id: "string", # realtime_log_config_arn: "string", # cache_policy_id: "string", # origin_request_policy_id: "string", # forwarded_values: { @@ -5540,10 +6023,19 @@ # event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response # include_body: false, # }, # ], # }, + # function_associations: { + # quantity: 1, # required + # items: [ + # { + # function_arn: "FunctionARN", # required + # event_type: "viewer-request", # required, accepts viewer-request, viewer-response, origin-request, origin-response + # }, + # ], + # }, # field_level_encryption_id: "string", # realtime_log_config_arn: "string", # cache_policy_id: "string", # origin_request_policy_id: "string", # forwarded_values: { @@ -5693,10 +6185,14 @@ # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.quantity #=> Integer # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items #=> Array # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].lambda_function_arn #=> String # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution.distribution_config.default_cache_behavior.lambda_function_associations.items[0].include_body #=> Boolean + # resp.distribution.distribution_config.default_cache_behavior.function_associations.quantity #=> Integer + # resp.distribution.distribution_config.default_cache_behavior.function_associations.items #=> Array + # resp.distribution.distribution_config.default_cache_behavior.function_associations.items[0].function_arn #=> String + # resp.distribution.distribution_config.default_cache_behavior.function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution.distribution_config.default_cache_behavior.field_level_encryption_id #=> String # resp.distribution.distribution_config.default_cache_behavior.realtime_log_config_arn #=> String # resp.distribution.distribution_config.default_cache_behavior.cache_policy_id #=> String # resp.distribution.distribution_config.default_cache_behavior.origin_request_policy_id #=> String # resp.distribution.distribution_config.default_cache_behavior.forwarded_values.query_string #=> Boolean @@ -5737,10 +6233,14 @@ # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.quantity #=> Integer # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items #=> Array # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].lambda_function_arn #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution.distribution_config.cache_behaviors.items[0].lambda_function_associations.items[0].include_body #=> Boolean + # resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.quantity #=> Integer + # resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items #=> Array + # resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items[0].function_arn #=> String + # resp.distribution.distribution_config.cache_behaviors.items[0].function_associations.items[0].event_type #=> String, one of "viewer-request", "viewer-response", "origin-request", "origin-response" # resp.distribution.distribution_config.cache_behaviors.items[0].field_level_encryption_id #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].realtime_log_config_arn #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].cache_policy_id #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].origin_request_policy_id #=> String # resp.distribution.distribution_config.cache_behaviors.items[0].forwarded_values.query_string #=> Boolean @@ -5944,10 +6444,76 @@ def update_field_level_encryption_profile(params = {}, options = {}) req = build_request(:update_field_level_encryption_profile, params) req.send_request(options) end + # Updates a CloudFront function. + # + # You can update a function’s code or the comment that describes the + # function. You cannot update a function’s name. + # + # To update a function, you provide the function’s name and version + # (`ETag` value) along with the updated function code. To get the name + # and version, you can use `ListFunctions` and `DescribeFunction`. + # + # @option params [required, String] :name + # The name of the function that you are updating. + # + # @option params [required, String] :if_match + # The current version (`ETag` value) of the function that you are + # updating, which you can get using `DescribeFunction`. + # + # @option params [required, Types::FunctionConfig] :function_config + # Configuration information about the function. + # + # @option params [required, String, StringIO, File] :function_code + # The function code. For more information about writing a CloudFront + # function, see [Writing function code for CloudFront Functions][1] in + # the *Amazon CloudFront Developer Guide*. + # + # + # + # [1]: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/writing-function-code.html + # + # @return [Types::UpdateFunctionResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods: + # + # * {Types::UpdateFunctionResult#function_summary #function_summary} => Types::FunctionSummary + # * {Types::UpdateFunctionResult#etag #etag} => String + # + # @example Request syntax with placeholder values + # + # resp = client.update_function({ + # name: "string", # required + # if_match: "string", # required + # function_config: { # required + # comment: "string", # required + # runtime: "cloudfront-js-1.0", # required, accepts cloudfront-js-1.0 + # }, + # function_code: "data", # required + # }) + # + # @example Response structure + # + # resp.function_summary.name #=> String + # resp.function_summary.status #=> String + # resp.function_summary.function_config.comment #=> String + # resp.function_summary.function_config.runtime #=> String, one of "cloudfront-js-1.0" + # resp.function_summary.function_metadata.function_arn #=> String + # resp.function_summary.function_metadata.stage #=> String, one of "DEVELOPMENT", "LIVE" + # resp.function_summary.function_metadata.created_time #=> Time + # resp.function_summary.function_metadata.last_modified_time #=> Time + # resp.etag #=> String + # + # @see http://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/UpdateFunction2020_05_31 AWS API Documentation + # + # @overload update_function(params = {}) + # @param [Hash] params ({}) + def update_function(params = {}, options = {}) + req = build_request(:update_function, params) + req.send_request(options) + end + # Updates a key group. # # When you update a key group, all the fields are updated with the # values provided in the request. You cannot update some fields # independent of others. To update a key group: @@ -6343,10 +6909,10 @@ operation: config.api.operation(operation_name), client: self, params: params, config: config) context[:gem_name] = 'aws-sdk-cloudfront' - context[:gem_version] = '1.49.0' + context[:gem_version] = '1.50.0' Seahorse::Client::Request.new(handlers, context) end # Polls an API operation until a resource enters a desired state. #