# coding: utf-8
# Copyright (c) 2016, 2026, Oracle and/or its affiliates.  All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.

# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20230222

from .create_credential_details import CreateCredentialDetails
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel, to_dict, redact_password_field  # noqa: F401
from oci.decorators import init_model_state_from_kwargs


@init_model_state_from_kwargs
class CreateCredentialBasicDetails(CreateCredentialDetails):
    """
    Details for the Credential for the Basic type.
    """

    def __init__(self, **kwargs):
        """
        Initializes a new CreateCredentialBasicDetails object with values from keyword arguments. The default value of the :py:attr:`~oci.database_tools_runtime.models.CreateCredentialBasicDetails.type` attribute
        of this class is ``BASIC`` and it should not be changed.
        The following keyword arguments are supported (corresponding to the getters/setters of this class):

        :param type:
            The value to assign to the type property of this CreateCredentialBasicDetails.
            Allowed values for this property are: "BASIC"
        :type type: str

        :param key:
            The value to assign to the key property of this CreateCredentialBasicDetails.
        :type key: str

        :param user_name:
            The value to assign to the user_name property of this CreateCredentialBasicDetails.
        :type user_name: str

        :param password:
            The value to assign to the password property of this CreateCredentialBasicDetails.
        :type password: str

        """
        self.swagger_types = {
            'type': 'str',
            'key': 'str',
            'user_name': 'str',
            'password': 'str'
        }
        self.attribute_map = {
            'type': 'type',
            'key': 'key',
            'user_name': 'userName',
            'password': 'password'
        }
        self._redacted_field_paths = [
            ['password'],
        ]
        self._type = None
        self._key = None
        self._user_name = None
        self._password = None
        self._type = 'BASIC'

    @property
    def user_name(self):
        """
        **[Required]** Gets the user_name of this CreateCredentialBasicDetails.
        The username for the new credential.


        :return: The user_name of this CreateCredentialBasicDetails.
        :rtype: str
        """
        return self._user_name

    @user_name.setter
    def user_name(self, user_name):
        """
        Sets the user_name of this CreateCredentialBasicDetails.
        The username for the new credential.


        :param user_name: The user_name of this CreateCredentialBasicDetails.
        :type: str
        """
        self._user_name = user_name

    @property
    def password(self):
        """
        **[Required]** Gets the password of this CreateCredentialBasicDetails.
        The password for the new credential.


        :return: The password of this CreateCredentialBasicDetails.
        :rtype: str
        """
        return self._password

    @password.setter
    def password(self, password):
        """
        Sets the password of this CreateCredentialBasicDetails.
        The password for the new credential.


        :param password: The password of this CreateCredentialBasicDetails.
        :type: str
        """
        self._password = password

    def __repr__(self):
        as_dict = to_dict(self)
        redact_password_field(as_dict, ['password'])
        return formatted_flat_dict(as_dict)

    def __eq__(self, other):
        if other is None:
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not self == other
