// 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{Setting: identitydomains.Setting{LoginTexts: []identitydomains.SettingsLoginTexts{identitydomains.SettingsLoginTexts{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")},
		CloudMigrationCustomUrl: common.String("EXAMPLE-cloudMigrationCustomUrl-Value"),
		DefaultLoginTexts: []identitydomains.SettingsDefaultLoginTexts{identitydomains.SettingsDefaultLoginTexts{Locale: common.String("EXAMPLE-locale-Value"),
			Value: common.String("EXAMPLE-value-Value")}},
		Images: []identitydomains.SettingsImages{identitydomains.SettingsImages{Value: common.String("EXAMPLE-value-Value"),
			Display: common.String("EXAMPLE-display-Value"),
			Type:    common.String("EXAMPLE-type-Value")}},
		Issuer: common.String("EXAMPLE-issuer-Value"),
		Tags: []identitydomains.Tags{identitydomains.Tags{Key: common.String("EXAMPLE-key-Value"),
			Value: common.String("EXAMPLE-value-Value")}},
		AllowedForgotPasswordFlowReturnUrls: []string{"EXAMPLE--Value"},
		ContactEmails:                       []string{"EXAMPLE--Value"},
		CustomHtmlLocation:                  common.String("EXAMPLE-customHtmlLocation-Value"),
		MaxNoOfAppCMVAToReturn:              common.Int(566),
		Ocid:                                common.String("EXAMPLE-ocid-Value"),
		TenancyOcid:                         common.String("EXAMPLE-tenancyOcid-Value"),
		AccountAlwaysTrustScope:             common.Bool(true),
		AuditEventRetentionPeriod:           common.Int(992),
		DeleteInProgress:                    common.Bool(true),
		DefaultTrustScope:                   identitydomains.SettingDefaultTrustScopeExplicit,
		EnableTermsOfUse:                    common.Bool(false),
		DefaultImages: []identitydomains.SettingsDefaultImages{identitydomains.SettingsDefaultImages{Display: common.String("EXAMPLE-display-Value"),
			Type:  common.String("EXAMPLE-type-Value"),
			Value: common.String("EXAMPLE-value-Value")}},
		MaxNoOfAppRoleMembersToReturn: common.Int(889),
		PreferredLanguage:             common.String("EXAMPLE-preferredLanguage-Value"),
		CustomBranding:                common.Bool(true),
		DiagnosticRecordForSearchIdentifiesReturnedResources: common.Bool(true),
		PurgeConfigs: []identitydomains.SettingsPurgeConfigs{identitydomains.SettingsPurgeConfigs{ResourceName: common.String("EXAMPLE-resourceName-Value"),
			RetentionPeriod: common.Int(792)}},
		TenantCustomClaims: []identitydomains.SettingsTenantCustomClaims{identitydomains.SettingsTenantCustomClaims{Mode: identitydomains.SettingsTenantCustomClaimsModeAlways,
			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)}},
		Timezone:                common.String("EXAMPLE-timezone-Value"),
		CustomTranslation:       common.String("EXAMPLE-customTranslation-Value"),
		IamUpstSessionExpiry:    common.Int(430),
		IdcsPreventedOperations: []identitydomains.IdcsPreventedOperationsEnum{identitydomains.IdcsPreventedOperationsReplace},
		CustomCssLocation:       common.String("EXAMPLE-customCssLocation-Value"),
		DiagnosticLevel:         common.Int(309),
		DomainOcid:              common.String("EXAMPLE-domainOcid-Value"),
		Id:                      common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value"),
		TermsOfUseUrl:           common.String("EXAMPLE-termsOfUseUrl-Value"),
		AllowedDomains:          []string{"EXAMPLE--Value"},
		CloudGateCorsSettings: &identitydomains.SettingsCloudGateCorsSettings{CloudGateCorsExposedHeaders: []string{"EXAMPLE--Value"},
			CloudGateCorsMaxAge:          common.Int(627),
			CloudGateCorsAllowNullOrigin: common.Bool(false),
			CloudGateCorsAllowedOrigins:  []string{"EXAMPLE--Value"},
			CloudGateCorsEnabled:         common.Bool(false)},
		CompartmentOcid:                           common.String("EXAMPLE-compartmentOcid-Value"),
		ReAuthFactor:                              []identitydomains.SettingReAuthFactorEnum{identitydomains.SettingReAuthFactorPassword},
		CloudAccountName:                          common.String("EXAMPLE-cloudAccountName-Value"),
		DiagnosticTracingUpto:                     common.String("EXAMPLE-diagnosticTracingUpto-Value"),
		PrevIssuer:                                common.String("EXAMPLE-prevIssuer-Value"),
		AllowedNotificationRedirectUrls:           []string{"EXAMPLE--Value"},
		ExternalId:                                common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-externalId-Value"),
		ServiceAdminCannotListOtherUsers:          common.Bool(false),
		CloudMigrationUrlEnabled:                  common.Bool(false),
		OnPremisesProvisioning:                    common.Bool(true),
		Schemas:                                   []string{"EXAMPLE--Value"},
		SigningCertPublicAccess:                   common.Bool(false),
		ReAuthWhenChangingMyAuthenticationFactors: common.Bool(false),
		IdcsLastUpgradedInRelease:                 common.String("EXAMPLE-idcsLastUpgradedInRelease-Value"),
		Locale:                                    common.String("EXAMPLE-locale-Value"),
		MigrationStatus:                           common.String("EXAMPLE-migrationStatus-Value"),
		CsrAccess:                                 identitydomains.SettingCsrAccessNone,
		IdcsLastModifiedBy: &identitydomains.IdcsLastModifiedBy{Value: common.String("EXAMPLE-value-Value"),
			Ref:     common.String("EXAMPLE-$ref-Value"),
			Display: common.String("EXAMPLE-display-Value"),
			Ocid:    common.String("EXAMPLE-ocid-Value"),
			Type:    identitydomains.IdcsLastModifiedByTypeApp},
		IdcsCreatedBy: &identitydomains.IdcsCreatedBy{Ref: common.String("EXAMPLE-$ref-Value"),
			Display: common.String("EXAMPLE-display-Value"),
			Ocid:    common.String("EXAMPLE-ocid-Value"),
			Type:    identitydomains.IdcsCreatedByTypeUser,
			Value:   common.String("EXAMPLE-value-Value")},
		IsHostedPage:     common.Bool(false),
		PrivacyPolicyUrl: common.String("EXAMPLE-privacyPolicyUrl-Value"),
		SubMappingAttr:   common.String("EXAMPLE-subMappingAttr-Value"),
		CertificateValidation: &identitydomains.SettingsCertificateValidation{CrlCheckOnOCSPFailureEnabled: common.Bool(true),
			CrlEnabled:                        common.Bool(true),
			CrlRefreshInterval:                common.Int(912),
			OcspEnabled:                       common.Bool(true),
			OcspUnknownResponseStatusAllowed:  common.Bool(true),
			CrlLocation:                       common.String("EXAMPLE-crlLocation-Value"),
			OcspResponderURL:                  common.String("EXAMPLE-ocspResponderURL-Value"),
			OcspSettingsResponderURLPreferred: common.Bool(true),
			OcspSigningCertificateAlias:       common.String("EXAMPLE-ocspSigningCertificateAlias-Value"),
			OcspTimeoutDuration:               common.Int(113)},
		CompanyNames: []identitydomains.SettingsCompanyNames{identitydomains.SettingsCompanyNames{Locale: common.String("EXAMPLE-locale-Value"),
			Value: common.String("EXAMPLE-value-Value")}},
		DefaultCompanyNames: []identitydomains.SettingsDefaultCompanyNames{identitydomains.SettingsDefaultCompanyNames{Locale: common.String("EXAMPLE-locale-Value"),
			Value: common.String("EXAMPLE-value-Value")}}},
		SettingId:                 common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-settingId-Value"),
		AttributeSets:             []identitydomains.AttributeSetsEnum{identitydomains.AttributeSetsAlways},
		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")}

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