// 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{IsHostedPage: common.Bool(true),
		OnPremisesProvisioning: common.Bool(false),
		PurgeConfigs: []identitydomains.SettingsPurgeConfigs{identitydomains.SettingsPurgeConfigs{ResourceName: common.String("EXAMPLE-resourceName-Value"),
			RetentionPeriod: common.Int(279)}},
		Tags: []identitydomains.Tags{identitydomains.Tags{Key: common.String("EXAMPLE-key-Value"),
			Value: common.String("EXAMPLE-value-Value")}},
		DeleteInProgress:              common.Bool(true),
		ExternalId:                    common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-externalId-Value"),
		MaxNoOfAppRoleMembersToReturn: common.Int(109),
		PrevIssuer:                    common.String("EXAMPLE-prevIssuer-Value"),
		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.IdcsLastModifiedByTypeUser},
		SubMappingAttr:                  common.String("EXAMPLE-subMappingAttr-Value"),
		AllowedNotificationRedirectUrls: []string{"EXAMPLE--Value"},
		CloudMigrationUrlEnabled:        common.Bool(true),
		DefaultCompanyNames: []identitydomains.SettingsDefaultCompanyNames{identitydomains.SettingsDefaultCompanyNames{Value: common.String("EXAMPLE-value-Value"),
			Locale: common.String("EXAMPLE-locale-Value")}},
		DefaultLoginTexts: []identitydomains.SettingsDefaultLoginTexts{identitydomains.SettingsDefaultLoginTexts{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")}},
		MaxNoOfAppCMVAToReturn: common.Int(633),
		ReAuthFactor:           []identitydomains.SettingReAuthFactorEnum{identitydomains.SettingReAuthFactorPassword},
		DiagnosticRecordForSearchIdentifiesReturnedResources: common.Bool(true),
		EnableTermsOfUse: common.Bool(false),
		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")},
		Schemas:                   []string{"EXAMPLE--Value"},
		MigrationStatus:           common.String("EXAMPLE-migrationStatus-Value"),
		PrivacyPolicyUrl:          common.String("EXAMPLE-privacyPolicyUrl-Value"),
		AuditEventRetentionPeriod: common.Int(847),
		CustomCssLocation:         common.String("EXAMPLE-customCssLocation-Value"),
		CustomHtmlLocation:        common.String("EXAMPLE-customHtmlLocation-Value"),
		DefaultTrustScope:         identitydomains.SettingDefaultTrustScopeAccount,
		AccountAlwaysTrustScope:   common.Bool(false),
		CloudGateCorsSettings: &identitydomains.SettingsCloudGateCorsSettings{CloudGateCorsAllowNullOrigin: common.Bool(true),
			CloudGateCorsAllowedOrigins: []string{"EXAMPLE--Value"},
			CloudGateCorsEnabled:        common.Bool(true),
			CloudGateCorsExposedHeaders: []string{"EXAMPLE--Value"},
			CloudGateCorsMaxAge:         common.Int(160)},
		ReAuthWhenChangingMyAuthenticationFactors: common.Bool(false),
		ServiceAdminCannotListOtherUsers:          common.Bool(false),
		AllowedForgotPasswordFlowReturnUrls:       []string{"EXAMPLE--Value"},
		CompanyNames: []identitydomains.SettingsCompanyNames{identitydomains.SettingsCompanyNames{Locale: common.String("EXAMPLE-locale-Value"),
			Value: common.String("EXAMPLE-value-Value")}},
		DomainOcid:                common.String("EXAMPLE-domainOcid-Value"),
		IdcsLastUpgradedInRelease: common.String("EXAMPLE-idcsLastUpgradedInRelease-Value"),
		LoginTexts: []identitydomains.SettingsLoginTexts{identitydomains.SettingsLoginTexts{Locale: common.String("EXAMPLE-locale-Value"),
			Value: common.String("EXAMPLE-value-Value")}},
		TermsOfUseUrl:           common.String("EXAMPLE-termsOfUseUrl-Value"),
		CloudMigrationCustomUrl: common.String("EXAMPLE-cloudMigrationCustomUrl-Value"),
		ContactEmails:           []string{"EXAMPLE--Value"},
		Ocid:                    common.String("EXAMPLE-ocid-Value"),
		PreferredLanguage:       common.String("EXAMPLE-preferredLanguage-Value"),
		IdcsCreatedBy: &identitydomains.IdcsCreatedBy{Ref: common.String("EXAMPLE-$ref-Value"),
			Display: common.String("EXAMPLE-display-Value"),
			Ocid:    common.String("EXAMPLE-ocid-Value"),
			Type:    identitydomains.IdcsCreatedByTypeApp,
			Value:   common.String("EXAMPLE-value-Value")},
		AllowedDomains:          []string{"EXAMPLE--Value"},
		CustomBranding:          common.Bool(true),
		Timezone:                common.String("EXAMPLE-timezone-Value"),
		Issuer:                  common.String("EXAMPLE-issuer-Value"),
		SigningCertPublicAccess: common.Bool(true),
		DiagnosticTracingUpto:   common.String("EXAMPLE-diagnosticTracingUpto-Value"),
		CertificateValidation: &identitydomains.SettingsCertificateValidation{CrlEnabled: common.Bool(true),
			OcspEnabled:                       common.Bool(true),
			OcspSettingsResponderURLPreferred: common.Bool(false),
			OcspSigningCertificateAlias:       common.String("EXAMPLE-ocspSigningCertificateAlias-Value"),
			OcspUnknownResponseStatusAllowed:  common.Bool(false),
			CrlLocation:                       common.String("EXAMPLE-crlLocation-Value"),
			CrlRefreshInterval:                common.Int(565),
			OcspResponderURL:                  common.String("EXAMPLE-ocspResponderURL-Value"),
			OcspTimeoutDuration:               common.Int(817),
			CrlCheckOnOCSPFailureEnabled:      common.Bool(true)},
		DefaultImages: []identitydomains.SettingsDefaultImages{identitydomains.SettingsDefaultImages{Display: common.String("EXAMPLE-display-Value"),
			Type:  common.String("EXAMPLE-type-Value"),
			Value: common.String("EXAMPLE-value-Value")}},
		DiagnosticLevel:         common.Int(673),
		CompartmentOcid:         common.String("EXAMPLE-compartmentOcid-Value"),
		CsrAccess:               identitydomains.SettingCsrAccessReadwrite,
		IdcsPreventedOperations: []identitydomains.IdcsPreventedOperationsEnum{identitydomains.IdcsPreventedOperationsReplace},
		TenancyOcid:             common.String("EXAMPLE-tenancyOcid-Value"),
		TenantCustomClaims: []identitydomains.SettingsTenantCustomClaims{identitydomains.SettingsTenantCustomClaims{Expression: common.Bool(true),
			Mode:      identitydomains.SettingsTenantCustomClaimsModeRequest,
			Name:      common.String("EXAMPLE-name-Value"),
			Scopes:    []string{"EXAMPLE--Value"},
			TokenType: identitydomains.SettingsTenantCustomClaimsTokenTypeAt,
			Value:     common.String("EXAMPLE-value-Value"),
			AllScopes: common.Bool(false)}},
		CloudAccountName:     common.String("EXAMPLE-cloudAccountName-Value"),
		CustomTranslation:    common.String("EXAMPLE-customTranslation-Value"),
		IamUpstSessionExpiry: common.Int(150),
		Locale:               common.String("EXAMPLE-locale-Value"),
		Id:                   common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value")},
		SettingId:                 common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-settingId-Value"),
		AttributeSets:             []identitydomains.AttributeSetsEnum{identitydomains.AttributeSetsNever},
		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)
}