// 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 ExamplePutIdentityProvider() {
	// 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.PutIdentityProviderRequest{Authorization: common.String("EXAMPLE-authorization-Value"),
		IdentityProvider: identitydomains.IdentityProvider{AuthnRequestBinding: identitydomains.IdentityProviderAuthnRequestBindingRedirect,
			RequiresEncryptedAssertion:                common.Bool(true),
			SamlHoKRequired:                           common.Bool(false),
			IdcsLastUpgradedInRelease:                 common.String("EXAMPLE-idcsLastUpgradedInRelease-Value"),
			JitUserProvGroupAssertionAttributeEnabled: common.Bool(false),
			JitUserProvGroupMappings: []identitydomains.IdentityProviderJitUserProvGroupMappings{identitydomains.IdentityProviderJitUserProvGroupMappings{IdpGroup: common.String("EXAMPLE-idpGroup-Value"),
				Value: common.String("EXAMPLE-value-Value"),
				Ref:   common.String("EXAMPLE-$ref-Value")}},
			UserMappingStoreAttribute:    common.String("EXAMPLE-userMappingStoreAttribute-Value"),
			Id:                           common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value"),
			JitUserProvCreateUserEnabled: common.Bool(true),
			SignatureHashAlgorithm:       identitydomains.IdentityProviderSignatureHashAlgorithm256,
			UrnIetfParamsScimSchemasOracleIdcsExtensionSocialIdentityProvider: &identitydomains.ExtensionSocialIdentityProvider{AuthzUrl: common.String("EXAMPLE-authzUrl-Value"),
				DiscoveryUrl:                 common.String("EXAMPLE-discoveryUrl-Value"),
				IdAttribute:                  common.String("EXAMPLE-idAttribute-Value"),
				ProfileUrl:                   common.String("EXAMPLE-profileUrl-Value"),
				Scope:                        []string{"EXAMPLE--Value"},
				SocialJitProvisioningEnabled: common.Bool(false),
				AdminScope:                   []string{"EXAMPLE--Value"},
				AppleKeyId:                   common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-appleKeyId-Value"),
				RegistrationEnabled:          common.Bool(true),
				Status:                       identitydomains.ExtensionSocialIdentityProviderStatusDeleted,
				ClientCredentialInPayload:    common.Bool(true),
				ConsumerKey:                  common.String("EXAMPLE-consumerKey-Value"),
				ConsumerSecret:               common.String("EXAMPLE-consumerSecret-Value"),
				RedirectUrl:                  common.String("EXAMPLE-redirectUrl-Value"),
				RelayIdpParamMappings: []identitydomains.IdentityProviderRelayIdpParamMappings{identitydomains.IdentityProviderRelayIdpParamMappings{RelayParamKey: common.String("EXAMPLE-relayParamKey-Value"),
					RelayParamValue: common.String("EXAMPLE-relayParamValue-Value")}},
				ServiceProviderName:   common.String("EXAMPLE-serviceProviderName-Value"),
				AccessTokenUrl:        common.String("EXAMPLE-accessTokenUrl-Value"),
				AccountLinkingEnabled: common.Bool(false),
				AppleDevId:            common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-appleDevId-Value"),
				AutoRedirectEnabled:   common.Bool(false),
				ClockSkewInSeconds:    common.Int(774),
				JitProvAssignedGroups: []identitydomains.IdentityProviderJitProvAssignedGroups{identitydomains.IdentityProviderJitProvAssignedGroups{Ref: common.String("EXAMPLE-$ref-Value"),
					Display: common.String("EXAMPLE-display-Value"),
					Value:   common.String("EXAMPLE-value-Value")}},
				JitProvGroupStaticListEnabled: common.Bool(false)},
			CompartmentOcid: common.String("EXAMPLE-compartmentOcid-Value"),
			JitUserProvAssignedGroups: []identitydomains.IdentityProviderJitUserProvAssignedGroups{identitydomains.IdentityProviderJitUserProvAssignedGroups{Ref: common.String("EXAMPLE-$ref-Value"),
				Display: common.String("EXAMPLE-display-Value"),
				Value:   common.String("EXAMPLE-value-Value")}},
			LastNotificationSentTime:    common.String("EXAMPLE-lastNotificationSentTime-Value"),
			LogoutBinding:               identitydomains.IdentityProviderLogoutBindingPost,
			LogoutResponseUrl:           common.String("EXAMPLE-logoutResponseUrl-Value"),
			PartnerName:                 common.String("EXAMPLE-partnerName-Value"),
			IdpSsoUrl:                   common.String("EXAMPLE-idpSsoUrl-Value"),
			JitUserProvGroupMappingMode: identitydomains.IdentityProviderJitUserProvGroupMappingModeImplicit,
			Schemas:                     []string{"EXAMPLE--Value"},
			TenancyOcid:                 common.String("EXAMPLE-tenancyOcid-Value"),
			IdcsCreatedBy: &identitydomains.IdcsCreatedBy{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.IdcsCreatedByTypeUser},
			JitUserProvGroupStaticListEnabled: common.Bool(false),
			PartnerProviderId:                 common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-partnerProviderId-Value"),
			Type:                              identitydomains.IdentityProviderTypeSocial,
			IncludeSigningCertInSignature:     common.Bool(false),
			JitUserProvAttributes: &identitydomains.IdentityProviderJitUserProvAttributes{Ref: common.String("EXAMPLE-$ref-Value"),
				Value: common.String("EXAMPLE-value-Value")},
			SuccinctId:                     common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-succinctId-Value"),
			TenantProviderId:               common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-tenantProviderId-Value"),
			DeleteInProgress:               common.Bool(false),
			IdcsPreventedOperations:        []identitydomains.IdcsPreventedOperationsEnum{identitydomains.IdcsPreventedOperationsReplace},
			RequestedAuthenticationContext: []string{"EXAMPLE--Value"},
			CorrelationPolicy: &identitydomains.IdentityProviderCorrelationPolicy{Value: common.String("EXAMPLE-value-Value"),
				Ref:     common.String("EXAMPLE-$ref-Value"),
				Display: common.String("EXAMPLE-display-Value"),
				Type:    identitydomains.IdentityProviderCorrelationPolicyTypePolicy},
			JitUserProvIgnoreErrorOnAbsentGroups: common.Bool(true),
			Metadata:                             common.String("EXAMPLE-metadata-Value"),
			AssertionAttribute:                   common.String("EXAMPLE-assertionAttribute-Value"),
			ExternalId:                           common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-externalId-Value"),
			JitUserProvEnabled:                   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")},
			UrnIetfParamsScimSchemasOracleIdcsExtensionX509IdentityProvider: &identitydomains.ExtensionX509IdentityProvider{CrlCheckOnOCSPFailureEnabled: common.Bool(true),
				CrlEnabled:                     common.Bool(false),
				OcspTrustCertChain:             []string{"EXAMPLE--Value"},
				UserMatchAttribute:             common.String("EXAMPLE-userMatchAttribute-Value"),
				CrlLocation:                    common.String("EXAMPLE-crlLocation-Value"),
				EkuValidationEnabled:           common.Bool(true),
				EkuValues:                      []identitydomains.ExtensionX509IdentityProviderEkuValuesEnum{identitydomains.ExtensionX509IdentityProviderEkuValuesCodeSigning},
				OcspEnableSignedResponse:       common.Bool(false),
				OcspEnabled:                    common.Bool(true),
				OcspServerName:                 common.String("EXAMPLE-ocspServerName-Value"),
				CrlReloadDuration:              common.Int(204),
				OcspResponderURL:               common.String("EXAMPLE-ocspResponderURL-Value"),
				OcspRevalidateTime:             common.Int(856),
				OtherCertMatchAttribute:        common.String("EXAMPLE-otherCertMatchAttribute-Value"),
				CertMatchAttribute:             common.String("EXAMPLE-certMatchAttribute-Value"),
				OcspAllowUnknownResponseStatus: common.Bool(false),
				SigningCertificateChain:        []string{"EXAMPLE--Value"}},
			JitUserProvAttributeUpdateEnabled: common.Bool(false),
			LogoutEnabled:                     common.Bool(false),
			Tags: []identitydomains.Tags{identitydomains.Tags{Key: common.String("EXAMPLE-key-Value"),
				Value: common.String("EXAMPLE-value-Value")}},
			IconUrl:                           common.String("EXAMPLE-iconUrl-Value"),
			NameIdFormat:                      common.String("EXAMPLE-nameIdFormat-Value"),
			ShownOnLoginPage:                  common.Bool(false),
			Description:                       common.String("EXAMPLE-description-Value"),
			Enabled:                           common.Bool(true),
			JitUserProvGroupSAMLAttributeName: common.String("EXAMPLE-jitUserProvGroupSAMLAttributeName-Value"),
			LogoutRequestUrl:                  common.String("EXAMPLE-logoutRequestUrl-Value"),
			Ocid:                              common.String("EXAMPLE-ocid-Value"),
			RequireForceAuthn:                 common.Bool(false),
			SigningCertificate:                common.String("EXAMPLE-signingCertificate-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.IdcsLastModifiedByTypeApp},
			DomainOcid:                       common.String("EXAMPLE-domainOcid-Value"),
			EncryptionCertificate:            common.String("EXAMPLE-encryptionCertificate-Value"),
			JitUserProvGroupAssignmentMethod: identitydomains.IdentityProviderJitUserProvGroupAssignmentMethodOverwrite,
			ServiceInstanceIdentifier:        common.String("EXAMPLE-serviceInstanceIdentifier-Value"),
			UserMappingMethod:                identitydomains.IdentityProviderUserMappingMethodNameidtouserattribute},
		IdentityProviderId:        common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-identityProviderId-Value"),
		IfMatch:                   common.String("EXAMPLE-ifMatch-Value"),
		OpcRetryToken:             common.String("EXAMPLE-opcRetryToken-Value"),
		ResourceTypeSchemaVersion: common.String("EXAMPLE-resourceTypeSchemaVersion-Value"),
		AttributeSets:             []identitydomains.AttributeSetsEnum{identitydomains.AttributeSetsAll},
		Attributes:                common.String("EXAMPLE-attributes-Value")}

	// Send the request using the service client
	resp, err := client.PutIdentityProvider(context.Background(), req)
	helpers.FatalIfError(err)

	// Retrieve value from the response.
	fmt.Println(resp)
}