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