// 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/common"
	"github.com/oracle/oci-go-sdk/v65/example/helpers"
	"github.com/oracle/oci-go-sdk/v65/identitydomains"
)

func ExamplePutSetting() {
	// 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 := identitydomains.NewIdentityDomainsClientWithConfigurationProvider(common.DefaultConfigProvider(), "specificEndpoint")
	helpers.FatalIfError(err)

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

	req := identitydomains.PutSettingRequest{SettingId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-settingId-Value"),
		AttributeSets:             []identitydomains.AttributeSetsEnum{identitydomains.AttributeSetsRequest},
		Attributes:                common.String("EXAMPLE-attributes-Value"),
		Authorization:             common.String("EXAMPLE-authorization-Value"),
		IfMatch:                   common.String("EXAMPLE-ifMatch-Value"),
		OpcRetryToken:             common.String("EXAMPLE-opcRetryToken-Value"),
		ResourceTypeSchemaVersion: common.String("EXAMPLE-resourceTypeSchemaVersion-Value"),
		Setting: identitydomains.Setting{ExternalId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-externalId-Value"),
			DefaultCompanyNames: []identitydomains.SettingsDefaultCompanyNames{identitydomains.SettingsDefaultCompanyNames{Value: common.String("EXAMPLE-value-Value"),
				Locale: common.String("EXAMPLE-locale-Value")}},
			IdcsPreventedOperations:   []identitydomains.IdcsPreventedOperationsEnum{identitydomains.IdcsPreventedOperationsUpdate},
			AuditEventRetentionPeriod: common.Int(265),
			CompanyNames: []identitydomains.SettingsCompanyNames{identitydomains.SettingsCompanyNames{Locale: common.String("EXAMPLE-locale-Value"),
				Value: common.String("EXAMPLE-value-Value")}},
			Ocid:                    common.String("EXAMPLE-ocid-Value"),
			SigningCertPublicAccess: common.Bool(false),
			TenancyOcid:             common.String("EXAMPLE-tenancyOcid-Value"),
			CustomCssLocation:       common.String("EXAMPLE-customCssLocation-Value"),
			DeleteInProgress:        common.Bool(false),
			IamUpstSessionExpiry:    common.Int(687),
			IsHostedPage:            common.Bool(false),
			MaxNoOfAppCMVAToReturn:  common.Int(499),
			CloudMigrationCustomUrl: common.String("EXAMPLE-cloudMigrationCustomUrl-Value"),
			DomainOcid:              common.String("EXAMPLE-domainOcid-Value"),
			IdcsCreatedBy: &identitydomains.IdcsCreatedBy{Type: identitydomains.IdcsCreatedByTypeApp,
				Value:   common.String("EXAMPLE-value-Value"),
				Ref:     common.String("EXAMPLE-$ref-Value"),
				Display: common.String("EXAMPLE-display-Value"),
				Ocid:    common.String("EXAMPLE-ocid-Value")},
			ReAuthWhenChangingMyAuthenticationFactors: common.Bool(false),
			SubMappingAttr:          common.String("EXAMPLE-subMappingAttr-Value"),
			AccountAlwaysTrustScope: common.Bool(false),
			AllowedDomains:          []string{"EXAMPLE--Value"},
			CustomHtmlLocation:      common.String("EXAMPLE-customHtmlLocation-Value"),
			DefaultLoginTexts: []identitydomains.SettingsDefaultLoginTexts{identitydomains.SettingsDefaultLoginTexts{Value: common.String("EXAMPLE-value-Value"),
				Locale: common.String("EXAMPLE-locale-Value")}},
			DiagnosticLevel: common.Int(193),
			LoginTexts: []identitydomains.SettingsLoginTexts{identitydomains.SettingsLoginTexts{Locale: common.String("EXAMPLE-locale-Value"),
				Value: common.String("EXAMPLE-value-Value")}},
			CloudGateCorsSettings: &identitydomains.SettingsCloudGateCorsSettings{CloudGateCorsEnabled: common.Bool(true),
				CloudGateCorsExposedHeaders:  []string{"EXAMPLE--Value"},
				CloudGateCorsMaxAge:          common.Int(831),
				CloudGateCorsAllowNullOrigin: common.Bool(false),
				CloudGateCorsAllowedOrigins:  []string{"EXAMPLE--Value"}},
			ContactEmails: []string{"EXAMPLE--Value"},
			DefaultImages: []identitydomains.SettingsDefaultImages{identitydomains.SettingsDefaultImages{Display: common.String("EXAMPLE-display-Value"),
				Type:  common.String("EXAMPLE-type-Value"),
				Value: common.String("EXAMPLE-value-Value")}},
			Issuer:                        common.String("EXAMPLE-issuer-Value"),
			CloudMigrationUrlEnabled:      common.Bool(true),
			Locale:                        common.String("EXAMPLE-locale-Value"),
			MaxNoOfAppRoleMembersToReturn: common.Int(650),
			PreferredLanguage:             common.String("EXAMPLE-preferredLanguage-Value"),
			CsrAccess:                     identitydomains.SettingCsrAccessNone,
			CustomTranslation:             common.String("EXAMPLE-customTranslation-Value"),
			Id:                            common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value"),
			IdcsLastModifiedBy: &identitydomains.IdcsLastModifiedBy{Ocid: common.String("EXAMPLE-ocid-Value"),
				Type:    identitydomains.IdcsLastModifiedByTypeUser,
				Value:   common.String("EXAMPLE-value-Value"),
				Ref:     common.String("EXAMPLE-$ref-Value"),
				Display: common.String("EXAMPLE-display-Value")},
			Schemas: []string{"EXAMPLE--Value"},
			Tags: []identitydomains.Tags{identitydomains.Tags{Key: common.String("EXAMPLE-key-Value"),
				Value: common.String("EXAMPLE-value-Value")}},
			TermsOfUseUrl: common.String("EXAMPLE-termsOfUseUrl-Value"),
			PurgeConfigs: []identitydomains.SettingsPurgeConfigs{identitydomains.SettingsPurgeConfigs{ResourceName: common.String("EXAMPLE-resourceName-Value"),
				RetentionPeriod: common.Int(809)}},
			ServiceAdminCannotListOtherUsers: common.Bool(true),
			CertificateValidation: &identitydomains.SettingsCertificateValidation{OcspResponderURL: common.String("EXAMPLE-ocspResponderURL-Value"),
				OcspSettingsResponderURLPreferred: common.Bool(true),
				OcspSigningCertificateAlias:       common.String("EXAMPLE-ocspSigningCertificateAlias-Value"),
				CrlEnabled:                        common.Bool(false),
				CrlRefreshInterval:                common.Int(794),
				OcspEnabled:                       common.Bool(false),
				OcspUnknownResponseStatusAllowed:  common.Bool(false),
				CrlCheckOnOCSPFailureEnabled:      common.Bool(true),
				CrlLocation:                       common.String("EXAMPLE-crlLocation-Value"),
				OcspTimeoutDuration:               common.Int(903)},
			CompartmentOcid:       common.String("EXAMPLE-compartmentOcid-Value"),
			DiagnosticTracingUpto: common.String("EXAMPLE-diagnosticTracingUpto-Value"),
			PrevIssuer:            common.String("EXAMPLE-prevIssuer-Value"),
			CloudAccountName:      common.String("EXAMPLE-cloudAccountName-Value"),
			DefaultTrustScope:     identitydomains.SettingDefaultTrustScopeAccount,
			Meta: &identitydomains.Meta{Created: common.String("EXAMPLE-created-Value"),
				LastModified: common.String("EXAMPLE-lastModified-Value"),
				Location:     common.String("EXAMPLE-location-Value"),
				ResourceType: common.String("EXAMPLE-resourceType-Value"),
				Version:      common.String("EXAMPLE-version-Value")},
			OnPremisesProvisioning:              common.Bool(false),
			ReAuthFactor:                        []identitydomains.SettingReAuthFactorEnum{identitydomains.SettingReAuthFactorPassword},
			AllowedNotificationRedirectUrls:     []string{"EXAMPLE--Value"},
			IdcsLastUpgradedInRelease:           common.String("EXAMPLE-idcsLastUpgradedInRelease-Value"),
			MigrationStatus:                     common.String("EXAMPLE-migrationStatus-Value"),
			AllowedForgotPasswordFlowReturnUrls: []string{"EXAMPLE--Value"},
			CustomBranding:                      common.Bool(true),
			DiagnosticRecordForSearchIdentifiesReturnedResources: common.Bool(false),
			EnableTermsOfUse: common.Bool(true),
			Images: []identitydomains.SettingsImages{identitydomains.SettingsImages{Value: common.String("EXAMPLE-value-Value"),
				Display: common.String("EXAMPLE-display-Value"),
				Type:    common.String("EXAMPLE-type-Value")}},
			PrivacyPolicyUrl: common.String("EXAMPLE-privacyPolicyUrl-Value"),
			TenantCustomClaims: []identitydomains.SettingsTenantCustomClaims{identitydomains.SettingsTenantCustomClaims{TokenType: identitydomains.SettingsTenantCustomClaimsTokenTypeIt,
				Value:      common.String("EXAMPLE-value-Value"),
				AllScopes:  common.Bool(true),
				Expression: common.Bool(false),
				Mode:       identitydomains.SettingsTenantCustomClaimsModeNever,
				Name:       common.String("EXAMPLE-name-Value"),
				Scopes:     []string{"EXAMPLE--Value"}}},
			Timezone: common.String("EXAMPLE-timezone-Value")}}

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

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