// 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).

package main

import (
	"context"
	"fmt"

	"github.com/oracle/oci-go-sdk/v65/apigateway"
	"github.com/oracle/oci-go-sdk/v65/common"
	"github.com/oracle/oci-go-sdk/v65/example/helpers"
)

func ExampleUpdateDeployment() {
	// Create a default authentication provider that uses the DEFAULT
	// profile in the configuration file.
	// Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.
	client, err := apigateway.NewDeploymentClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

	// Create a request and dependent object(s).

	req := apigateway.UpdateDeploymentRequest{DeploymentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-deploymentId-Value"),
		IfMatch:        common.String("EXAMPLE-ifMatch-Value"),
		IsLockOverride: common.Bool(false),
		OpcRequestId:   common.String("3W0CA9GRGHJJWZ6DW87A<unique_ID>"),
		UpdateDeploymentDetails: apigateway.UpdateDeploymentDetails{DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_QJ3ni": map[string]interface{}{"EXAMPLE_KEY_AIWJs": "EXAMPLE--Value"}},
			DisplayName:  common.String("EXAMPLE-displayName-Value"),
			FreeformTags: map[string]string{"EXAMPLE_KEY_RKmXW": "EXAMPLE_VALUE_zDBJE5SghdEom0zACxLd"},
			Specification: &apigateway.ApiSpecification{LoggingPolicies: &apigateway.ApiSpecificationLoggingPolicies{ExecutionLog: &apigateway.ExecutionLogPolicy{IsEnabled: common.Bool(false),
				LogLevel: apigateway.ExecutionLogPolicyLogLevelError},
				AccessLog: &apigateway.AccessLogPolicy{IsEnabled: common.Bool(false)}},
				RequestPolicies: &apigateway.ApiSpecificationRequestPolicies{MutualTls: &apigateway.MutualTlsDetails{AllowedSans: []string{"EXAMPLE--Value"},
					IsVerifiedCertificateRequired: common.Bool(false)},
					RateLimiting: &apigateway.RateLimitingPolicy{RateInRequestsPerSecond: common.Int(511),
						RateKey: apigateway.RateLimitingPolicyRateKeyTotal},
					UsagePlans: &apigateway.UsagePlansPolicy{TokenLocations: []string{"EXAMPLE--Value"}},
					Authentication: apigateway.JwtAuthenticationPolicy{Audiences: []string{"EXAMPLE--Value"},
						IsAnonymousAccessAllowed: common.Bool(true),
						MaxClockSkewInSeconds:    common.Float32(11.048412),
						TokenAuthScheme:          common.String("EXAMPLE-tokenAuthScheme-Value"),
						TokenHeader:              common.String("EXAMPLE-tokenHeader-Value"),
						TokenQueryParam:          common.String("EXAMPLE-tokenQueryParam-Value"),
						VerifyClaims: []apigateway.JsonWebTokenClaim{apigateway.JsonWebTokenClaim{IsRequired: common.Bool(true),
							Key:    common.String("EXAMPLE-key-Value"),
							Values: []string{"EXAMPLE--Value"}}},
						Issuers: []string{"EXAMPLE--Value"},
						PublicKeys: apigateway.RemoteJsonWebKeySet{IsSslVerifyDisabled: common.Bool(false),
							MaxCacheDurationInHours: common.Int(20),
							Uri:                     common.String("EXAMPLE-uri-Value")}},
					Cors: &apigateway.CorsPolicy{AllowedHeaders: []string{"EXAMPLE--Value"},
						AllowedMethods:            []string{"EXAMPLE--Value"},
						AllowedOrigins:            []string{"EXAMPLE--Value"},
						ExposedHeaders:            []string{"EXAMPLE--Value"},
						IsAllowCredentialsEnabled: common.Bool(false),
						MaxAgeInSeconds:           common.Int(986)},
					DynamicAuthentication: &apigateway.DynamicAuthenticationPolicy{AuthenticationServers: []apigateway.AuthenticationServerPolicy{apigateway.AuthenticationServerPolicy{AuthenticationServerDetail: apigateway.TokenAuthenticationPolicy{ValidationFailurePolicy: apigateway.ModifyResponseValidationFailurePolicy{ResponseCode: common.String("EXAMPLE-responseCode-Value"),
						ResponseHeaderTransformations: &apigateway.HeaderTransformationPolicy{RenameHeaders: &apigateway.RenameHeaderPolicy{Items: []apigateway.RenameHeaderPolicyItem{apigateway.RenameHeaderPolicyItem{From: common.String("EXAMPLE-from-Value"),
							To: common.String("EXAMPLE-to-Value")}}},
							SetHeaders: &apigateway.SetHeaderPolicy{Items: []apigateway.SetHeaderPolicyItem{apigateway.SetHeaderPolicyItem{IfExists: apigateway.SetHeaderPolicyItemIfExistsSkip,
								Name:   common.String("EXAMPLE-name-Value"),
								Values: []string{"EXAMPLE--Value"}}}},
							FilterHeaders: &apigateway.FilterHeaderPolicy{Items: []apigateway.FilterHeaderPolicyItem{apigateway.FilterHeaderPolicyItem{Name: common.String("EXAMPLE-name-Value")}}}},
						ResponseMessage: common.String("EXAMPLE-responseMessage-Value")},
						ValidationPolicy: apigateway.TokenAuthenticationRemoteJwksValidationPolicy{IsSslVerifyDisabled: common.Bool(false),
							MaxCacheDurationInHours: common.Int(12),
							Uri:                     common.String("EXAMPLE-uri-Value"),
							AdditionalValidationPolicy: &apigateway.AdditionalValidationPolicy{Audiences: []string{"EXAMPLE--Value"},
								Issuers: []string{"EXAMPLE--Value"},
								VerifyClaims: []apigateway.JsonWebTokenClaim{apigateway.JsonWebTokenClaim{IsRequired: common.Bool(true),
									Key:    common.String("EXAMPLE-key-Value"),
									Values: []string{"EXAMPLE--Value"}}}}},
						IsAnonymousAccessAllowed: common.Bool(true),
						MaxClockSkewInSeconds:    common.Float32(88.48731),
						TokenAuthScheme:          common.String("EXAMPLE-tokenAuthScheme-Value"),
						TokenHeader:              common.String("EXAMPLE-tokenHeader-Value"),
						TokenQueryParam:          common.String("EXAMPLE-tokenQueryParam-Value")},
						Key: apigateway.AnyOfSelectionKey{Name: common.String("EXAMPLE-name-Value"),
							Values:    []string{"EXAMPLE--Value"},
							IsDefault: common.Bool(true)}}},
						SelectionSource: apigateway.SingleSelectionSourcePolicy{Selector: common.String("EXAMPLE-selector-Value")}}},
				Routes: []apigateway.ApiSpecificationRoute{apigateway.ApiSpecificationRoute{ResponsePolicies: &apigateway.ApiSpecificationRouteResponsePolicies{HeaderTransformations: &apigateway.HeaderTransformationPolicy{FilterHeaders: &apigateway.FilterHeaderPolicy{Items: []apigateway.FilterHeaderPolicyItem{apigateway.FilterHeaderPolicyItem{Name: common.String("EXAMPLE-name-Value")}},
					Type: apigateway.FilterHeaderPolicyTypeBlock},
					RenameHeaders: &apigateway.RenameHeaderPolicy{Items: []apigateway.RenameHeaderPolicyItem{apigateway.RenameHeaderPolicyItem{From: common.String("EXAMPLE-from-Value"),
						To: common.String("EXAMPLE-to-Value")}}},
					SetHeaders: &apigateway.SetHeaderPolicy{Items: []apigateway.SetHeaderPolicyItem{apigateway.SetHeaderPolicyItem{IfExists: apigateway.SetHeaderPolicyItemIfExistsSkip,
						Name:   common.String("EXAMPLE-name-Value"),
						Values: []string{"EXAMPLE--Value"}}}}},
					ResponseCacheStore: apigateway.FixedTtlResponseCacheStorePolicy{TimeToLiveInSeconds: common.Int(792)}},
					Backend: apigateway.StockResponseBackend{Status: common.Int(537),
						Body: common.String("EXAMPLE-body-Value"),
						Headers: []apigateway.HeaderFieldSpecification{apigateway.HeaderFieldSpecification{Name: common.String("EXAMPLE-name-Value"),
							Value: common.String("EXAMPLE-value-Value")}}},
					LoggingPolicies: &apigateway.ApiSpecificationLoggingPolicies{AccessLog: &apigateway.AccessLogPolicy{IsEnabled: common.Bool(true)},
						ExecutionLog: &apigateway.ExecutionLogPolicy{IsEnabled: common.Bool(true),
							LogLevel: apigateway.ExecutionLogPolicyLogLevelError}},
					Methods: []apigateway.ApiSpecificationRouteMethodsEnum{apigateway.ApiSpecificationRouteMethodsPut},
					Path:    common.String("EXAMPLE-path-Value"),
					RequestPolicies: &apigateway.ApiSpecificationRouteRequestPolicies{QueryParameterValidations: &apigateway.QueryParameterValidationRequestPolicy{Parameters: []apigateway.QueryParameterValidationItem{apigateway.QueryParameterValidationItem{Name: common.String("EXAMPLE-name-Value"),
						Required: common.Bool(true)}},
						ValidationMode: apigateway.QueryParameterValidationRequestPolicyValidationModePermissive},
						ResponseCacheLookup: apigateway.SimpleLookupPolicy{CacheKeyAdditions: []string{"EXAMPLE--Value"},
							IsEnabled:               common.Bool(false),
							IsPrivateCachingEnabled: common.Bool(true)},
						Authorization: apigateway.AnyOfRouteAuthorizationPolicy{AllowedScope: []string{"EXAMPLE--Value"}},
						BodyValidation: &apigateway.BodyValidationRequestPolicy{Content: map[string]apigateway.ContentValidation{"EXAMPLE_KEY_N4HmC": apigateway.NoContentValidation{}},
							Required:       common.Bool(false),
							ValidationMode: apigateway.BodyValidationRequestPolicyValidationModePermissive},
						Cors: &apigateway.CorsPolicy{MaxAgeInSeconds: common.Int(727),
							AllowedHeaders:            []string{"EXAMPLE--Value"},
							AllowedMethods:            []string{"EXAMPLE--Value"},
							AllowedOrigins:            []string{"EXAMPLE--Value"},
							ExposedHeaders:            []string{"EXAMPLE--Value"},
							IsAllowCredentialsEnabled: common.Bool(false)},
						HeaderTransformations: &apigateway.HeaderTransformationPolicy{FilterHeaders: &apigateway.FilterHeaderPolicy{Items: []apigateway.FilterHeaderPolicyItem{apigateway.FilterHeaderPolicyItem{Name: common.String("EXAMPLE-name-Value")}},
							Type: apigateway.FilterHeaderPolicyTypeAllow},
							RenameHeaders: &apigateway.RenameHeaderPolicy{Items: []apigateway.RenameHeaderPolicyItem{apigateway.RenameHeaderPolicyItem{From: common.String("EXAMPLE-from-Value"),
								To: common.String("EXAMPLE-to-Value")}}},
							SetHeaders: &apigateway.SetHeaderPolicy{Items: []apigateway.SetHeaderPolicyItem{apigateway.SetHeaderPolicyItem{IfExists: apigateway.SetHeaderPolicyItemIfExistsOverwrite,
								Name:   common.String("EXAMPLE-name-Value"),
								Values: []string{"EXAMPLE--Value"}}}}},
						HeaderValidations: &apigateway.HeaderValidationRequestPolicy{Headers: []apigateway.HeaderValidationItem{apigateway.HeaderValidationItem{Name: common.String("EXAMPLE-name-Value"),
							Required: common.Bool(false)}},
							ValidationMode: apigateway.HeaderValidationRequestPolicyValidationModeDisabled},
						QueryParameterTransformations: &apigateway.QueryParameterTransformationPolicy{FilterQueryParameters: &apigateway.FilterQueryParameterPolicy{Items: []apigateway.FilterQueryParameterPolicyItem{apigateway.FilterQueryParameterPolicyItem{Name: common.String("EXAMPLE-name-Value")}},
							Type: apigateway.FilterQueryParameterPolicyTypeAllow},
							RenameQueryParameters: &apigateway.RenameQueryParameterPolicy{Items: []apigateway.RenameQueryParameterPolicyItem{apigateway.RenameQueryParameterPolicyItem{From: common.String("EXAMPLE-from-Value"),
								To: common.String("EXAMPLE-to-Value")}}},
							SetQueryParameters: &apigateway.SetQueryParameterPolicy{Items: []apigateway.SetQueryParameterPolicyItem{apigateway.SetQueryParameterPolicyItem{IfExists: apigateway.SetQueryParameterPolicyItemIfExistsAppend,
								Name:   common.String("EXAMPLE-name-Value"),
								Values: []string{"EXAMPLE--Value"}}}}}}}}}}}

	// Send the request using the service client
	resp, err := client.UpdateDeployment(context.Background(), req)
	helpers.FatalIfError(err)

	// Retrieve value from the response.
	fmt.Println(resp)
}