1# coding: utf-8
2# Copyright (c) 2016, 2021, Oracle and/or its affiliates.  All rights reserved.
3# 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.
4
5
6from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel  # noqa: F401
7from oci.decorators import init_model_state_from_kwargs
8
9
10@init_model_state_from_kwargs
11class DatabaseCredentials(object):
12    """
13    The database credentials used to perform management activity.
14    """
15
16    #: A constant which can be used with the role property of a DatabaseCredentials.
17    #: This constant has a value of "NORMAL"
18    ROLE_NORMAL = "NORMAL"
19
20    #: A constant which can be used with the role property of a DatabaseCredentials.
21    #: This constant has a value of "SYSDBA"
22    ROLE_SYSDBA = "SYSDBA"
23
24    def __init__(self, **kwargs):
25        """
26        Initializes a new DatabaseCredentials object with values from keyword arguments.
27        The following keyword arguments are supported (corresponding to the getters/setters of this class):
28
29        :param user_name:
30            The value to assign to the user_name property of this DatabaseCredentials.
31        :type user_name: str
32
33        :param password:
34            The value to assign to the password property of this DatabaseCredentials.
35        :type password: str
36
37        :param secret_id:
38            The value to assign to the secret_id property of this DatabaseCredentials.
39        :type secret_id: str
40
41        :param role:
42            The value to assign to the role property of this DatabaseCredentials.
43            Allowed values for this property are: "NORMAL", "SYSDBA"
44        :type role: str
45
46        """
47        self.swagger_types = {
48            'user_name': 'str',
49            'password': 'str',
50            'secret_id': 'str',
51            'role': 'str'
52        }
53
54        self.attribute_map = {
55            'user_name': 'userName',
56            'password': 'password',
57            'secret_id': 'secretId',
58            'role': 'role'
59        }
60
61        self._user_name = None
62        self._password = None
63        self._secret_id = None
64        self._role = None
65
66    @property
67    def user_name(self):
68        """
69        Gets the user_name of this DatabaseCredentials.
70        The database user name used to perform management activity.
71
72
73        :return: The user_name of this DatabaseCredentials.
74        :rtype: str
75        """
76        return self._user_name
77
78    @user_name.setter
79    def user_name(self, user_name):
80        """
81        Sets the user_name of this DatabaseCredentials.
82        The database user name used to perform management activity.
83
84
85        :param user_name: The user_name of this DatabaseCredentials.
86        :type: str
87        """
88        self._user_name = user_name
89
90    @property
91    def password(self):
92        """
93        Gets the password of this DatabaseCredentials.
94        The password for the database user name.
95
96
97        :return: The password of this DatabaseCredentials.
98        :rtype: str
99        """
100        return self._password
101
102    @password.setter
103    def password(self, password):
104        """
105        Sets the password of this DatabaseCredentials.
106        The password for the database user name.
107
108
109        :param password: The password of this DatabaseCredentials.
110        :type: str
111        """
112        self._password = password
113
114    @property
115    def secret_id(self):
116        """
117        Gets the secret_id of this DatabaseCredentials.
118        The `OCID`__ of the secret containing the user password.
119
120        __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
121
122
123        :return: The secret_id of this DatabaseCredentials.
124        :rtype: str
125        """
126        return self._secret_id
127
128    @secret_id.setter
129    def secret_id(self, secret_id):
130        """
131        Sets the secret_id of this DatabaseCredentials.
132        The `OCID`__ of the secret containing the user password.
133
134        __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
135
136
137        :param secret_id: The secret_id of this DatabaseCredentials.
138        :type: str
139        """
140        self._secret_id = secret_id
141
142    @property
143    def role(self):
144        """
145        Gets the role of this DatabaseCredentials.
146        The role of the database user. Indicates whether the database user is a normal user or sysdba.
147
148        Allowed values for this property are: "NORMAL", "SYSDBA"
149
150
151        :return: The role of this DatabaseCredentials.
152        :rtype: str
153        """
154        return self._role
155
156    @role.setter
157    def role(self, role):
158        """
159        Sets the role of this DatabaseCredentials.
160        The role of the database user. Indicates whether the database user is a normal user or sysdba.
161
162
163        :param role: The role of this DatabaseCredentials.
164        :type: str
165        """
166        allowed_values = ["NORMAL", "SYSDBA"]
167        if not value_allowed_none_or_none_sentinel(role, allowed_values):
168            raise ValueError(
169                "Invalid value for `role`, must be None or one of {0}"
170                .format(allowed_values)
171            )
172        self._role = role
173
174    def __repr__(self):
175        return formatted_flat_dict(self)
176
177    def __eq__(self, other):
178        if other is None:
179            return False
180
181        return self.__dict__ == other.__dict__
182
183    def __ne__(self, other):
184        return not self == other
185