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

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

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