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