# This is an automatically generated code sample.
# To make this code sample work in your Oracle Cloud tenancy,
# please replace the values for any parameters whose current values do not fit
# your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
# boolean, number, and enum parameters with values not fitting your use case).

import oci

# Create a default config using DEFAULT profile in default location
# Refer to
# https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File
# for more info
config = oci.config.from_file()


# Initialize service client with default config file
apigateway_client = oci.apigateway.DeploymentClient(config)


# Send the request to service, some parameters are not required, see API
# doc for more info
update_deployment_response = apigateway_client.update_deployment(
    deployment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-deploymentId-Value",
    update_deployment_details=oci.apigateway.models.UpdateDeploymentDetails(
        display_name="EXAMPLE-displayName-Value",
        specification=oci.apigateway.models.ApiSpecification(
            request_policies=oci.apigateway.models.ApiSpecificationRequestPolicies(
                authentication=oci.apigateway.models.JwtAuthenticationPolicy(
                    type="JWT_AUTHENTICATION",
                    issuers=["EXAMPLE--Value"],
                    audiences=["EXAMPLE--Value"],
                    public_keys=oci.apigateway.models.StaticPublicKeySet(
                        type="STATIC_KEYS",
                        keys=[
                            oci.apigateway.models.PemEncodedPublicKey(
                                format="PEM",
                                kid="EXAMPLE-kid-Value",
                                key="EXAMPLE-key-Value")]),
                    is_anonymous_access_allowed=False,
                    token_header="EXAMPLE-tokenHeader-Value",
                    token_query_param="EXAMPLE-tokenQueryParam-Value",
                    token_auth_scheme="EXAMPLE-tokenAuthScheme-Value",
                    verify_claims=[
                        oci.apigateway.models.JsonWebTokenClaim(
                            key="EXAMPLE-key-Value",
                            values=["EXAMPLE--Value"],
                            is_required=False)],
                    max_clock_skew_in_seconds=43.420197),
                rate_limiting=oci.apigateway.models.RateLimitingPolicy(
                    rate_in_requests_per_second=805,
                    rate_key="TOTAL"),
                cors=oci.apigateway.models.CorsPolicy(
                    allowed_origins=["EXAMPLE--Value"],
                    allowed_methods=["EXAMPLE--Value"],
                    allowed_headers=["EXAMPLE--Value"],
                    exposed_headers=["EXAMPLE--Value"],
                    is_allow_credentials_enabled=True,
                    max_age_in_seconds=159)),
            logging_policies=oci.apigateway.models.ApiSpecificationLoggingPolicies(
                access_log=oci.apigateway.models.AccessLogPolicy(
                    is_enabled=True),
                execution_log=oci.apigateway.models.ExecutionLogPolicy(
                    is_enabled=True,
                    log_level="INFO")),
            routes=[
                oci.apigateway.models.ApiSpecificationRoute(
                    path="EXAMPLE-path-Value",
                    backend=oci.apigateway.models.StockResponseBackend(
                        type="STOCK_RESPONSE_BACKEND",
                        status=807,
                        body="EXAMPLE-body-Value",
                        headers=[
                            oci.apigateway.models.HeaderFieldSpecification(
                                name="EXAMPLE-name-Value",
                                value="EXAMPLE-value-Value")]),
                    methods=["ANY"],
                    request_policies=oci.apigateway.models.ApiSpecificationRouteRequestPolicies(
                        authorization=oci.apigateway.models.AnyOfRouteAuthorizationPolicy(
                            type="ANY_OF",
                            allowed_scope=["EXAMPLE--Value"]),
                        cors=oci.apigateway.models.CorsPolicy(
                            allowed_origins=["EXAMPLE--Value"],
                            allowed_methods=["EXAMPLE--Value"],
                            allowed_headers=["EXAMPLE--Value"],
                            exposed_headers=["EXAMPLE--Value"],
                            is_allow_credentials_enabled=False,
                            max_age_in_seconds=500),
                        query_parameter_validations=oci.apigateway.models.QueryParameterValidationRequestPolicy(
                            parameters=[
                                oci.apigateway.models.QueryParameterValidationItem(
                                    name="EXAMPLE-name-Value",
                                    required=True)],
                            validation_mode="ENFORCING"),
                        header_validations=oci.apigateway.models.HeaderValidationRequestPolicy(
                            headers=[
                                oci.apigateway.models.HeaderValidationItem(
                                    name="EXAMPLE-name-Value",
                                    required=True)],
                            validation_mode="PERMISSIVE"),
                        body_validation=oci.apigateway.models.BodyValidationRequestPolicy(
                            content={
                                'EXAMPLE_KEY_lIRUg': {
                                    'validationType': 'NONE'}},
                            required=True,
                            validation_mode="PERMISSIVE"),
                        header_transformations=oci.apigateway.models.HeaderTransformationPolicy(
                            set_headers=oci.apigateway.models.SetHeaderPolicy(
                                items=[
                                    oci.apigateway.models.SetHeaderPolicyItem(
                                        name="EXAMPLE-name-Value",
                                        values=["EXAMPLE--Value"],
                                        if_exists="OVERWRITE")]),
                            rename_headers=oci.apigateway.models.RenameHeaderPolicy(
                                items=[
                                    oci.apigateway.models.RenameHeaderPolicyItem(
                                        _from="EXAMPLE-from-Value",
                                        to="EXAMPLE-to-Value")]),
                            filter_headers=oci.apigateway.models.FilterHeaderPolicy(
                                type="ALLOW",
                                items=[
                                    oci.apigateway.models.FilterHeaderPolicyItem(
                                        name="EXAMPLE-name-Value")])),
                        query_parameter_transformations=oci.apigateway.models.QueryParameterTransformationPolicy(
                            set_query_parameters=oci.apigateway.models.SetQueryParameterPolicy(
                                items=[
                                    oci.apigateway.models.SetQueryParameterPolicyItem(
                                        name="EXAMPLE-name-Value",
                                        values=["EXAMPLE--Value"],
                                        if_exists="APPEND")]),
                            rename_query_parameters=oci.apigateway.models.RenameQueryParameterPolicy(
                                items=[
                                    oci.apigateway.models.RenameQueryParameterPolicyItem(
                                        _from="EXAMPLE-from-Value",
                                        to="EXAMPLE-to-Value")]),
                            filter_query_parameters=oci.apigateway.models.FilterQueryParameterPolicy(
                                type="ALLOW",
                                items=[
                                    oci.apigateway.models.FilterQueryParameterPolicyItem(
                                        name="EXAMPLE-name-Value")])),
                        response_cache_lookup=oci.apigateway.models.SimpleLookupPolicy(
                            type="SIMPLE_LOOKUP_POLICY",
                            is_enabled=False,
                            is_private_caching_enabled=True,
                            cache_key_additions=["EXAMPLE--Value"])),
                    response_policies=oci.apigateway.models.ApiSpecificationRouteResponsePolicies(
                        header_transformations=oci.apigateway.models.HeaderTransformationPolicy(
                            set_headers=oci.apigateway.models.SetHeaderPolicy(
                                items=[
                                    oci.apigateway.models.SetHeaderPolicyItem(
                                        name="EXAMPLE-name-Value",
                                        values=["EXAMPLE--Value"],
                                        if_exists="SKIP")]),
                            rename_headers=oci.apigateway.models.RenameHeaderPolicy(
                                items=[
                                    oci.apigateway.models.RenameHeaderPolicyItem(
                                        _from="EXAMPLE-from-Value",
                                        to="EXAMPLE-to-Value")]),
                            filter_headers=oci.apigateway.models.FilterHeaderPolicy(
                                type="ALLOW",
                                items=[
                                    oci.apigateway.models.FilterHeaderPolicyItem(
                                        name="EXAMPLE-name-Value")])),
                        response_cache_store=oci.apigateway.models.FixedTTLResponseCacheStorePolicy(
                            type="FIXED_TTL_STORE_POLICY",
                            time_to_live_in_seconds=285)),
                    logging_policies=oci.apigateway.models.ApiSpecificationLoggingPolicies(
                        access_log=oci.apigateway.models.AccessLogPolicy(
                            is_enabled=False),
                        execution_log=oci.apigateway.models.ExecutionLogPolicy(
                            is_enabled=False,
                            log_level="WARN")))]),
        freeform_tags={
            'EXAMPLE_KEY_lXloD': 'EXAMPLE_VALUE_sH0Ib1Lyoh4DvZQfqXJR'},
        defined_tags={
            'EXAMPLE_KEY_J6blW': {
                'EXAMPLE_KEY_V7IDM': 'EXAMPLE--Value'}}),
    if_match="EXAMPLE-ifMatch-Value",
    opc_request_id="PYV6Y1OIGCAB6QQBVB1T/OpcRequestIdExample/<unique_ID>")

# Get the data from response
print(update_deployment_response.data)