// 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 ExamplePutPasswordPolicy() {
	// 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.PutPasswordPolicyRequest{Attributes: common.String("EXAMPLE-attributes-Value"),
		Authorization: common.String("EXAMPLE-authorization-Value"),
		IfMatch:       common.String("EXAMPLE-ifMatch-Value"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
		PasswordPolicy: identitydomains.PasswordPolicy{DeleteInProgress: common.Bool(true),
			DictionaryLocation:            common.String("EXAMPLE-dictionaryLocation-Value"),
			DisallowedUserAttributeValues: []string{"EXAMPLE--Value"},
			FirstNameDisallowed:           common.Bool(true),
			IdcsLastModifiedBy: &identitydomains.IdcsLastModifiedBy{Ref: common.String("EXAMPLE-$ref-Value"),
				Display: common.String("EXAMPLE-display-Value"),
				Ocid:    common.String("EXAMPLE-ocid-Value"),
				Type:    identitydomains.IdcsLastModifiedByTypeApp,
				Value:   common.String("EXAMPLE-value-Value")},
			MinLowerCase:   common.Int(680),
			MinPasswordAge: common.Int(636),
			Tags: []identitydomains.Tags{identitydomains.Tags{Key: common.String("EXAMPLE-key-Value"),
				Value: common.String("EXAMPLE-value-Value")}},
			ConfiguredPasswordPolicyRules: []identitydomains.PasswordPolicyConfiguredPasswordPolicyRules{identitydomains.PasswordPolicyConfiguredPasswordPolicyRules{Key: common.String("EXAMPLE-key-Value"),
				Value: common.String("EXAMPLE-value-Value")}},
			DictionaryWordDisallowed: common.Bool(true),
			ExternalId:               common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-externalId-Value"),
			Id:                       common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value"),
			MaxSpecialChars:          common.Int(839),
			MinAlphaNumerals:         common.Int(624),
			DictionaryDelimiter:      common.String("EXAMPLE-dictionaryDelimiter-Value"),
			DomainOcid:               common.String("EXAMPLE-domainOcid-Value"),
			Groups: []identitydomains.PasswordPolicyGroups{identitydomains.PasswordPolicyGroups{Ref: common.String("EXAMPLE-$ref-Value"),
				Display: common.String("EXAMPLE-display-Value"),
				Value:   common.String("EXAMPLE-value-Value")}},
			Ocid:               common.String("EXAMPLE-ocid-Value"),
			Schemas:            []string{"EXAMPLE--Value"},
			DistinctCharacters: common.Int(323),
			MaxLength:          common.Int(551),
			MinLength:          common.Int(232),
			Name:               common.String("EXAMPLE-name-Value"),
			StartsWithAlphabet: common.Bool(false),
			UserNameDisallowed: common.Bool(true),
			IdcsCreatedBy: &identitydomains.IdcsCreatedBy{Ref: common.String("EXAMPLE-$ref-Value"),
				Display: common.String("EXAMPLE-display-Value"),
				Ocid:    common.String("EXAMPLE-ocid-Value"),
				Type:    identitydomains.IdcsCreatedByTypeApp,
				Value:   common.String("EXAMPLE-value-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")},
			MinNumerals:               common.Int(386),
			MinUpperCase:              common.Int(532),
			NumPasswordsInHistory:     common.Int(308),
			PasswordExpiresAfter:      common.Int(284),
			RequiredChars:             common.String("EXAMPLE-requiredChars-Value"),
			TenancyOcid:               common.String("EXAMPLE-tenancyOcid-Value"),
			CompartmentOcid:           common.String("EXAMPLE-compartmentOcid-Value"),
			ForcePasswordReset:        common.Bool(false),
			IdcsPreventedOperations:   []identitydomains.IdcsPreventedOperationsEnum{identitydomains.IdcsPreventedOperationsReplace},
			MaxRepeatedChars:          common.Int(707),
			MinAlphas:                 common.Int(33),
			MinSpecialChars:           common.Int(480),
			PasswordExpireWarning:     common.Int(133),
			PasswordStrength:          identitydomains.PasswordPolicyPasswordStrengthStandard,
			AllowedChars:              common.String("EXAMPLE-allowedChars-Value"),
			Description:               common.String("EXAMPLE-description-Value"),
			DisallowedSubstrings:      []string{"EXAMPLE--Value"},
			IdcsLastUpgradedInRelease: common.String("EXAMPLE-idcsLastUpgradedInRelease-Value"),
			LastNameDisallowed:        common.Bool(false),
			MaxIncorrectAttempts:      common.Int(598),
			Priority:                  common.Int(319),
			DisallowedChars:           common.String("EXAMPLE-disallowedChars-Value"),
			LockoutDuration:           common.Int(169),
			MinUniqueChars:            common.Int(292)},
		PasswordPolicyId:          common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-passwordPolicyId-Value"),
		ResourceTypeSchemaVersion: common.String("EXAMPLE-resourceTypeSchemaVersion-Value"),
		AttributeSets:             []identitydomains.AttributeSetsEnum{identitydomains.AttributeSetsDefault}}

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

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