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

import oci

# Create a default config using DEFAULT profile in default location
# Refer to
# https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File
# for more info
config = oci.config.from_file()


# Initialize service client with default config file
identity_domains_client = oci.identity_domains.IdentityDomainsClient(
    config, "https://endpoint_of_this_service.com")


# Send the request to service, some parameters are not required, see API
# doc for more info
put_password_policy_response = identity_domains_client.put_password_policy(
    password_policy_id="ocid1.test.oc1..<unique_ID>EXAMPLE-passwordPolicyId-Value",
    authorization="EXAMPLE-authorization-Value",
    resource_type_schema_version="EXAMPLE-resourceTypeSchemaVersion-Value",
    attributes="EXAMPLE-attributes-Value",
    attribute_sets=["always"],
    password_policy=oci.identity_domains.models.PasswordPolicy(
        schemas=["EXAMPLE--Value"],
        name="EXAMPLE-name-Value",
        id="ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
        ocid="EXAMPLE-ocid-Value",
        meta=oci.identity_domains.models.Meta(
            resource_type="EXAMPLE-resourceType-Value",
            created="EXAMPLE-created-Value",
            last_modified="EXAMPLE-lastModified-Value",
            location="EXAMPLE-location-Value",
            version="EXAMPLE-version-Value"),
        idcs_created_by=oci.identity_domains.models.IdcsCreatedBy(
            value="EXAMPLE-value-Value",
            ref=None,
            type="User",
            display="EXAMPLE-display-Value",
            ocid="EXAMPLE-ocid-Value"),
        idcs_last_modified_by=oci.identity_domains.models.IdcsLastModifiedBy(
            value="EXAMPLE-value-Value",
            ref=None,
            type="User",
            display="EXAMPLE-display-Value",
            ocid="EXAMPLE-ocid-Value"),
        idcs_prevented_operations=["replace"],
        tags=[
            oci.identity_domains.models.Tags(
                key="EXAMPLE-key-Value",
                value="EXAMPLE-value-Value")],
        delete_in_progress=False,
        idcs_last_upgraded_in_release="EXAMPLE-idcsLastUpgradedInRelease-Value",
        domain_ocid="EXAMPLE-domainOcid-Value",
        compartment_ocid="EXAMPLE-compartmentOcid-Value",
        tenancy_ocid="EXAMPLE-tenancyOcid-Value",
        external_id="ocid1.test.oc1..<unique_ID>EXAMPLE-externalId-Value",
        description="EXAMPLE-description-Value",
        max_length=805,
        min_length=935,
        min_alphas=358,
        min_numerals=38,
        min_alpha_numerals=909,
        min_special_chars=374,
        max_special_chars=100,
        min_lower_case=916,
        min_upper_case=219,
        min_unique_chars=70,
        max_repeated_chars=348,
        starts_with_alphabet=True,
        first_name_disallowed=False,
        last_name_disallowed=False,
        user_name_disallowed=False,
        disallowed_user_attribute_values=["EXAMPLE--Value"],
        min_password_age=400,
        password_expires_after=421,
        password_expire_warning=747,
        required_chars="EXAMPLE-requiredChars-Value",
        disallowed_chars="EXAMPLE-disallowedChars-Value",
        allowed_chars="EXAMPLE-allowedChars-Value",
        disallowed_substrings=["EXAMPLE--Value"],
        dictionary_word_disallowed=True,
        dictionary_location="EXAMPLE-dictionaryLocation-Value",
        dictionary_delimiter="EXAMPLE-dictionaryDelimiter-Value",
        max_incorrect_attempts=36,
        lockout_duration=212,
        num_passwords_in_history=203,
        password_strength="Custom",
        force_password_reset=False,
        distinct_characters=701,
        priority=628,
        groups=[
            oci.identity_domains.models.PasswordPolicyGroups(
                value="EXAMPLE-value-Value",
                ref=None,
                display="EXAMPLE-display-Value")],
        configured_password_policy_rules=[
            oci.identity_domains.models.PasswordPolicyConfiguredPasswordPolicyRules(
                key="EXAMPLE-key-Value",
                value="EXAMPLE-value-Value")]),
    if_match="EXAMPLE-ifMatch-Value",
    opc_retry_token="EXAMPLE-opcRetryToken-Value")

# Get the data from response
print(put_password_policy_response.data)