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

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Oci.IdentitydomainsService;
using Oci.Common;
using Oci.Common.Auth;

namespace Oci.Sdk.DotNet.Example.Identitydomains
{
    public class PutSettingExample
    {
        public static async Task Main()
        {
            // Create a request and dependent object(s).
			var setting = new Oci.IdentitydomainsService.Models.Setting
			{
				Id = "ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
				Ocid = "EXAMPLE-ocid-Value",
				Schemas = new List<string>
				{
					"EXAMPLE--Value"
				},
				Meta = new Oci.IdentitydomainsService.Models.Meta
				{
					ResourceType = "EXAMPLE-resourceType-Value",
					Created = "EXAMPLE-created-Value",
					LastModified = "EXAMPLE-lastModified-Value",
					Location = "EXAMPLE-location-Value",
					Version = "EXAMPLE-version-Value"
				},
				IdcsCreatedBy = new Oci.IdentitydomainsService.Models.IdcsCreatedBy
				{
					Value = "EXAMPLE-value-Value",
					Ref = "EXAMPLE-$ref-Value",
					Type = Oci.IdentitydomainsService.Models.IdcsCreatedBy.TypeEnum.App,
					Display = "EXAMPLE-display-Value",
					Ocid = "EXAMPLE-ocid-Value"
				},
				IdcsLastModifiedBy = new Oci.IdentitydomainsService.Models.IdcsLastModifiedBy
				{
					Value = "EXAMPLE-value-Value",
					Ref = "EXAMPLE-$ref-Value",
					Type = Oci.IdentitydomainsService.Models.IdcsLastModifiedBy.TypeEnum.User,
					Display = "EXAMPLE-display-Value",
					Ocid = "EXAMPLE-ocid-Value"
				},
				IdcsPreventedOperations = new List<Oci.IdentitydomainsService.Models.IdcsPreventedOperations>
				{
					Oci.IdentitydomainsService.Models.IdcsPreventedOperations.Update
				},
				Tags = new List<Oci.IdentitydomainsService.Models.Tags>
				{
					new Oci.IdentitydomainsService.Models.Tags
					{
						Key = "EXAMPLE-key-Value",
						Value = "EXAMPLE-value-Value"
					}
				},
				DeleteInProgress = true,
				IdcsLastUpgradedInRelease = "EXAMPLE-idcsLastUpgradedInRelease-Value",
				DomainOcid = "EXAMPLE-domainOcid-Value",
				CompartmentOcid = "EXAMPLE-compartmentOcid-Value",
				TenancyOcid = "EXAMPLE-tenancyOcid-Value",
				ExternalId = "ocid1.test.oc1..<unique_ID>EXAMPLE-externalId-Value",
				ContactEmails = new List<string>
				{
					"EXAMPLE--Value"
				},
				CustomBranding = true,
				PreferredLanguage = "EXAMPLE-preferredLanguage-Value",
				Timezone = "EXAMPLE-timezone-Value",
				DiagnosticRecordForSearchIdentifiesReturnedResources = true,
				ReAuthWhenChangingMyAuthenticationFactors = false,
				ReAuthFactor = new List<Oci.IdentitydomainsService.Models.Setting.ReAuthFactorEnum>
				{
					Oci.IdentitydomainsService.Models.Setting.ReAuthFactorEnum.Password
				},
				Locale = "EXAMPLE-locale-Value",
				CsrAccess = Oci.IdentitydomainsService.Models.Setting.CsrAccessEnum.None,
				SigningCertPublicAccess = false,
				SubMappingAttr = "EXAMPLE-subMappingAttr-Value",
				AccountAlwaysTrustScope = true,
				DefaultTrustScope = Oci.IdentitydomainsService.Models.Setting.DefaultTrustScopeEnum.Tags,
				Issuer = "EXAMPLE-issuer-Value",
				PrevIssuer = "EXAMPLE-prevIssuer-Value",
				DiagnosticLevel = 811,
				DiagnosticTracingUpto = "EXAMPLE-diagnosticTracingUpto-Value",
				AllowedDomains = new List<string>
				{
					"EXAMPLE--Value"
				},
				EnableTermsOfUse = true,
				TermsOfUseUrl = "EXAMPLE-termsOfUseUrl-Value",
				PrivacyPolicyUrl = "EXAMPLE-privacyPolicyUrl-Value",
				MigrationStatus = "EXAMPLE-migrationStatus-Value",
				OnPremisesProvisioning = false,
				AllowedForgotPasswordFlowReturnUrls = new List<string>
				{
					"EXAMPLE--Value"
				},
				AllowedNotificationRedirectUrls = new List<string>
				{
					"EXAMPLE--Value"
				},
				AuditEventRetentionPeriod = 583,
				IsHostedPage = false,
				CustomHtmlLocation = "EXAMPLE-customHtmlLocation-Value",
				CustomCssLocation = "EXAMPLE-customCssLocation-Value",
				CustomTranslation = "EXAMPLE-customTranslation-Value",
				CloudAccountName = "EXAMPLE-cloudAccountName-Value",
				CloudMigrationUrlEnabled = true,
				CloudMigrationCustomUrl = "EXAMPLE-cloudMigrationCustomUrl-Value",
				ServiceAdminCannotListOtherUsers = false,
				MaxNoOfAppRoleMembersToReturn = 948,
				MaxNoOfAppCMVAToReturn = 171,
				IamUpstSessionExpiry = 528,
				CloudGateCorsSettings = new Oci.IdentitydomainsService.Models.SettingsCloudGateCorsSettings
				{
					CloudGateCorsAllowNullOrigin = true,
					CloudGateCorsEnabled = false,
					CloudGateCorsAllowedOrigins = new List<string>
					{
						"EXAMPLE--Value"
					},
					CloudGateCorsMaxAge = 695,
					CloudGateCorsExposedHeaders = new List<string>
					{
						"EXAMPLE--Value"
					}
				},
				CertificateValidation = new Oci.IdentitydomainsService.Models.SettingsCertificateValidation
				{
					CrlEnabled = false,
					CrlCheckOnOCSPFailureEnabled = false,
					CrlLocation = "EXAMPLE-crlLocation-Value",
					CrlRefreshInterval = 959,
					OcspEnabled = true,
					OcspUnknownResponseStatusAllowed = false,
					OcspResponderURL = "EXAMPLE-ocspResponderURL-Value",
					OcspSettingsResponderURLPreferred = false,
					OcspTimeoutDuration = 839,
					OcspSigningCertificateAlias = "EXAMPLE-ocspSigningCertificateAlias-Value"
				},
				TenantCustomClaims = new List<Oci.IdentitydomainsService.Models.SettingsTenantCustomClaims>
				{
					new Oci.IdentitydomainsService.Models.SettingsTenantCustomClaims
					{
						Name = "EXAMPLE-name-Value",
						Value = "EXAMPLE-value-Value",
						Mode = Oci.IdentitydomainsService.Models.SettingsTenantCustomClaims.ModeEnum.Never,
						Expression = false,
						AllScopes = false,
						TokenType = Oci.IdentitydomainsService.Models.SettingsTenantCustomClaims.TokenTypeEnum.Both,
						Scopes = new List<string>
						{
							"EXAMPLE--Value"
						}
					}
				},
				PurgeConfigs = new List<Oci.IdentitydomainsService.Models.SettingsPurgeConfigs>
				{
					new Oci.IdentitydomainsService.Models.SettingsPurgeConfigs
					{
						ResourceName = "EXAMPLE-resourceName-Value",
						RetentionPeriod = 749
					}
				},
				DefaultCompanyNames = new List<Oci.IdentitydomainsService.Models.SettingsDefaultCompanyNames>
				{
					new Oci.IdentitydomainsService.Models.SettingsDefaultCompanyNames
					{
						Value = "EXAMPLE-value-Value",
						Locale = "EXAMPLE-locale-Value"
					}
				},
				DefaultLoginTexts = new List<Oci.IdentitydomainsService.Models.SettingsDefaultLoginTexts>
				{
					new Oci.IdentitydomainsService.Models.SettingsDefaultLoginTexts
					{
						Value = "EXAMPLE-value-Value",
						Locale = "EXAMPLE-locale-Value"
					}
				},
				DefaultImages = new List<Oci.IdentitydomainsService.Models.SettingsDefaultImages>
				{
					new Oci.IdentitydomainsService.Models.SettingsDefaultImages
					{
						Value = "EXAMPLE-value-Value",
						Type = "EXAMPLE-type-Value",
						Display = "EXAMPLE-display-Value"
					}
				},
				CompanyNames = new List<Oci.IdentitydomainsService.Models.SettingsCompanyNames>
				{
					new Oci.IdentitydomainsService.Models.SettingsCompanyNames
					{
						Value = "EXAMPLE-value-Value",
						Locale = "EXAMPLE-locale-Value"
					}
				},
				LoginTexts = new List<Oci.IdentitydomainsService.Models.SettingsLoginTexts>
				{
					new Oci.IdentitydomainsService.Models.SettingsLoginTexts
					{
						Value = "EXAMPLE-value-Value",
						Locale = "EXAMPLE-locale-Value"
					}
				},
				Images = new List<Oci.IdentitydomainsService.Models.SettingsImages>
				{
					new Oci.IdentitydomainsService.Models.SettingsImages
					{
						Value = "EXAMPLE-value-Value",
						Type = "EXAMPLE-type-Value",
						Display = "EXAMPLE-display-Value"
					}
				}
			};
			var putSettingRequest = new Oci.IdentitydomainsService.Requests.PutSettingRequest
			{
				SettingId = "ocid1.test.oc1..<unique_ID>EXAMPLE-settingId-Value",
				Authorization = "EXAMPLE-authorization-Value",
				ResourceTypeSchemaVersion = "EXAMPLE-resourceTypeSchemaVersion-Value",
				Attributes = "EXAMPLE-attributes-Value",
				AttributeSets = new List<Oci.IdentitydomainsService.Models.AttributeSets>
				{
					Oci.IdentitydomainsService.Models.AttributeSets.Default
				},
				Setting = setting,
				IfMatch = "EXAMPLE-ifMatch-Value",
				OpcRetryToken = "EXAMPLE-opcRetryToken-Value"
			};

            // 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. 
            var provider = new ConfigFileAuthenticationDetailsProvider("DEFAULT");
            try
            {
                // Create a service client and send the request.
				using (var client = new IdentityDomainsClient(provider, new ClientConfiguration()))
				{
					var response = await client.PutSetting(putSettingRequest);
					// Retrieve value from the response.
					var id = response.Setting.Id;
				}
            }
            catch (Exception e)
            {
                Console.WriteLine($"PutSetting Failed with {e.Message}");
                throw e;
            }
        }

    }
}