// 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{IfMatch: common.String("EXAMPLE-ifMatch-Value"),
		OpcRetryToken:             common.String("EXAMPLE-opcRetryToken-Value"),
		ResourceTypeSchemaVersion: common.String("EXAMPLE-resourceTypeSchemaVersion-Value"),
		Setting: identitydomains.Setting{SigningCertPublicAccess: common.Bool(true),
			DomainOcid:                          common.String("EXAMPLE-domainOcid-Value"),
			TermsOfUseUrl:                       common.String("EXAMPLE-termsOfUseUrl-Value"),
			AllowedForgotPasswordFlowReturnUrls: []string{"EXAMPLE--Value"},
			DefaultLoginTexts: []identitydomains.SettingsDefaultLoginTexts{identitydomains.SettingsDefaultLoginTexts{Locale: common.String("EXAMPLE-locale-Value"),
				Value: common.String("EXAMPLE-value-Value")}},
			EnableTermsOfUse: common.Bool(false),
			MigrationStatus:  common.String("EXAMPLE-migrationStatus-Value"),
			ReAuthWhenChangingMyAuthenticationFactors: common.Bool(false),
			Meta: &identitydomains.Meta{ResourceType: common.String("EXAMPLE-resourceType-Value"),
				Version:      common.String("EXAMPLE-version-Value"),
				Created:      common.String("EXAMPLE-created-Value"),
				LastModified: common.String("EXAMPLE-lastModified-Value"),
				Location:     common.String("EXAMPLE-location-Value")},
			TenantCustomClaims: []identitydomains.SettingsTenantCustomClaims{identitydomains.SettingsTenantCustomClaims{Expression: common.Bool(true),
				Mode:      identitydomains.SettingsTenantCustomClaimsModeAlways,
				Name:      common.String("EXAMPLE-name-Value"),
				Scopes:    []string{"EXAMPLE--Value"},
				TokenType: identitydomains.SettingsTenantCustomClaimsTokenTypeIt,
				Value:     common.String("EXAMPLE-value-Value"),
				AllScopes: common.Bool(true)}},
			PrevIssuer:              common.String("EXAMPLE-prevIssuer-Value"),
			AllowedDomains:          []string{"EXAMPLE--Value"},
			CompartmentOcid:         common.String("EXAMPLE-compartmentOcid-Value"),
			DiagnosticTracingUpto:   common.String("EXAMPLE-diagnosticTracingUpto-Value"),
			PreferredLanguage:       common.String("EXAMPLE-preferredLanguage-Value"),
			Schemas:                 []string{"EXAMPLE--Value"},
			AccountAlwaysTrustScope: common.Bool(false),
			DiagnosticRecordForSearchIdentifiesReturnedResources: common.Bool(false),
			IdcsCreatedBy: &identitydomains.IdcsCreatedBy{Display: common.String("EXAMPLE-display-Value"),
				Ocid:  common.String("EXAMPLE-ocid-Value"),
				Type:  identitydomains.IdcsCreatedByTypeApp,
				Value: common.String("EXAMPLE-value-Value"),
				Ref:   common.String("EXAMPLE-$ref-Value")},
			Timezone:                  common.String("EXAMPLE-timezone-Value"),
			CloudMigrationUrlEnabled:  common.Bool(true),
			ContactEmails:             []string{"EXAMPLE--Value"},
			IdcsLastUpgradedInRelease: common.String("EXAMPLE-idcsLastUpgradedInRelease-Value"),
			IsHostedPage:              common.Bool(false),
			Locale:                    common.String("EXAMPLE-locale-Value"),
			MaxNoOfAppCMVAToReturn:    common.Int(581),
			TenancyOcid:               common.String("EXAMPLE-tenancyOcid-Value"),
			CompanyNames: []identitydomains.SettingsCompanyNames{identitydomains.SettingsCompanyNames{Locale: common.String("EXAMPLE-locale-Value"),
				Value: common.String("EXAMPLE-value-Value")}},
			CustomBranding:                   common.Bool(false),
			DefaultTrustScope:                identitydomains.SettingDefaultTrustScopeExplicit,
			ServiceAdminCannotListOtherUsers: common.Bool(true),
			Tags: []identitydomains.Tags{identitydomains.Tags{Key: common.String("EXAMPLE-key-Value"),
				Value: common.String("EXAMPLE-value-Value")}},
			AllowedNotificationRedirectUrls: []string{"EXAMPLE--Value"},
			IdcsLastModifiedBy: &identitydomains.IdcsLastModifiedBy{Display: common.String("EXAMPLE-display-Value"),
				Ocid:  common.String("EXAMPLE-ocid-Value"),
				Type:  identitydomains.IdcsLastModifiedByTypeApp,
				Value: common.String("EXAMPLE-value-Value"),
				Ref:   common.String("EXAMPLE-$ref-Value")},
			MaxNoOfAppRoleMembersToReturn: common.Int(8),
			PrivacyPolicyUrl:              common.String("EXAMPLE-privacyPolicyUrl-Value"),
			PurgeConfigs: []identitydomains.SettingsPurgeConfigs{identitydomains.SettingsPurgeConfigs{ResourceName: common.String("EXAMPLE-resourceName-Value"),
				RetentionPeriod: common.Int(98)}},
			ReAuthFactor:              []identitydomains.SettingReAuthFactorEnum{identitydomains.SettingReAuthFactorPassword},
			AuditEventRetentionPeriod: common.Int(804),
			DeleteInProgress:          common.Bool(true),
			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")}},
			CustomCssLocation: common.String("EXAMPLE-customCssLocation-Value"),
			DefaultCompanyNames: []identitydomains.SettingsDefaultCompanyNames{identitydomains.SettingsDefaultCompanyNames{Locale: common.String("EXAMPLE-locale-Value"),
				Value: common.String("EXAMPLE-value-Value")}},
			Issuer:         common.String("EXAMPLE-issuer-Value"),
			SubMappingAttr: common.String("EXAMPLE-subMappingAttr-Value"),
			CertificateValidation: &identitydomains.SettingsCertificateValidation{OcspTimeoutDuration: common.Int(62),
				CrlEnabled:                        common.Bool(true),
				CrlLocation:                       common.String("EXAMPLE-crlLocation-Value"),
				CrlRefreshInterval:                common.Int(730),
				OcspResponderURL:                  common.String("EXAMPLE-ocspResponderURL-Value"),
				OcspUnknownResponseStatusAllowed:  common.Bool(false),
				CrlCheckOnOCSPFailureEnabled:      common.Bool(false),
				OcspEnabled:                       common.Bool(false),
				OcspSettingsResponderURLPreferred: common.Bool(false),
				OcspSigningCertificateAlias:       common.String("EXAMPLE-ocspSigningCertificateAlias-Value")},
			CsrAccess: identitydomains.SettingCsrAccessNone,
			DefaultImages: []identitydomains.SettingsDefaultImages{identitydomains.SettingsDefaultImages{Value: common.String("EXAMPLE-value-Value"),
				Display: common.String("EXAMPLE-display-Value"),
				Type:    common.String("EXAMPLE-type-Value")}},
			OnPremisesProvisioning: common.Bool(false),
			CloudGateCorsSettings: &identitydomains.SettingsCloudGateCorsSettings{CloudGateCorsAllowNullOrigin: common.Bool(false),
				CloudGateCorsAllowedOrigins: []string{"EXAMPLE--Value"},
				CloudGateCorsEnabled:        common.Bool(false),
				CloudGateCorsExposedHeaders: []string{"EXAMPLE--Value"},
				CloudGateCorsMaxAge:         common.Int(331)},
			CustomTranslation:       common.String("EXAMPLE-customTranslation-Value"),
			IamUpstSessionExpiry:    common.Int(829),
			CloudAccountName:        common.String("EXAMPLE-cloudAccountName-Value"),
			CustomHtmlLocation:      common.String("EXAMPLE-customHtmlLocation-Value"),
			DiagnosticLevel:         common.Int(800),
			Id:                      common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value"),
			Ocid:                    common.String("EXAMPLE-ocid-Value"),
			CloudMigrationCustomUrl: common.String("EXAMPLE-cloudMigrationCustomUrl-Value"),
			ExternalId:              common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-externalId-Value"),
			IdcsPreventedOperations: []identitydomains.IdcsPreventedOperationsEnum{identitydomains.IdcsPreventedOperationsReplace}},
		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")}

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