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 IdpGroupMapping(object):
12    """
13    A mapping between a single group defined by the identity provider (IdP) you're federating with
14    and a single IAM Service :class:`Group` in Oracle Cloud Infrastructure.
15    For more information about group mappings and what they're for, see
16    `Identity Providers and Federation`__.
17
18    A given IdP group can be mapped to zero, one, or multiple IAM Service groups, and vice versa.
19    But each `IdPGroupMapping` object is between only a single IdP group and IAM Service group.
20    Each `IdPGroupMapping` object has its own OCID.
21
22    **Note:** Any users who are in more than 50 IdP groups cannot be authenticated to use the Oracle
23    Cloud Infrastructure Console.
24
25    __ https://docs.cloud.oracle.com/Content/Identity/Concepts/federation.htm
26    """
27
28    #: A constant which can be used with the lifecycle_state property of a IdpGroupMapping.
29    #: This constant has a value of "CREATING"
30    LIFECYCLE_STATE_CREATING = "CREATING"
31
32    #: A constant which can be used with the lifecycle_state property of a IdpGroupMapping.
33    #: This constant has a value of "ACTIVE"
34    LIFECYCLE_STATE_ACTIVE = "ACTIVE"
35
36    #: A constant which can be used with the lifecycle_state property of a IdpGroupMapping.
37    #: This constant has a value of "INACTIVE"
38    LIFECYCLE_STATE_INACTIVE = "INACTIVE"
39
40    #: A constant which can be used with the lifecycle_state property of a IdpGroupMapping.
41    #: This constant has a value of "DELETING"
42    LIFECYCLE_STATE_DELETING = "DELETING"
43
44    #: A constant which can be used with the lifecycle_state property of a IdpGroupMapping.
45    #: This constant has a value of "DELETED"
46    LIFECYCLE_STATE_DELETED = "DELETED"
47
48    def __init__(self, **kwargs):
49        """
50        Initializes a new IdpGroupMapping object with values from keyword arguments.
51        The following keyword arguments are supported (corresponding to the getters/setters of this class):
52
53        :param id:
54            The value to assign to the id property of this IdpGroupMapping.
55        :type id: str
56
57        :param idp_id:
58            The value to assign to the idp_id property of this IdpGroupMapping.
59        :type idp_id: str
60
61        :param idp_group_name:
62            The value to assign to the idp_group_name property of this IdpGroupMapping.
63        :type idp_group_name: str
64
65        :param group_id:
66            The value to assign to the group_id property of this IdpGroupMapping.
67        :type group_id: str
68
69        :param compartment_id:
70            The value to assign to the compartment_id property of this IdpGroupMapping.
71        :type compartment_id: str
72
73        :param time_created:
74            The value to assign to the time_created property of this IdpGroupMapping.
75        :type time_created: datetime
76
77        :param lifecycle_state:
78            The value to assign to the lifecycle_state property of this IdpGroupMapping.
79            Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", 'UNKNOWN_ENUM_VALUE'.
80            Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
81        :type lifecycle_state: str
82
83        :param inactive_status:
84            The value to assign to the inactive_status property of this IdpGroupMapping.
85        :type inactive_status: int
86
87        """
88        self.swagger_types = {
89            'id': 'str',
90            'idp_id': 'str',
91            'idp_group_name': 'str',
92            'group_id': 'str',
93            'compartment_id': 'str',
94            'time_created': 'datetime',
95            'lifecycle_state': 'str',
96            'inactive_status': 'int'
97        }
98
99        self.attribute_map = {
100            'id': 'id',
101            'idp_id': 'idpId',
102            'idp_group_name': 'idpGroupName',
103            'group_id': 'groupId',
104            'compartment_id': 'compartmentId',
105            'time_created': 'timeCreated',
106            'lifecycle_state': 'lifecycleState',
107            'inactive_status': 'inactiveStatus'
108        }
109
110        self._id = None
111        self._idp_id = None
112        self._idp_group_name = None
113        self._group_id = None
114        self._compartment_id = None
115        self._time_created = None
116        self._lifecycle_state = None
117        self._inactive_status = None
118
119    @property
120    def id(self):
121        """
122        **[Required]** Gets the id of this IdpGroupMapping.
123        The OCID of the `IdpGroupMapping`.
124
125
126        :return: The id of this IdpGroupMapping.
127        :rtype: str
128        """
129        return self._id
130
131    @id.setter
132    def id(self, id):
133        """
134        Sets the id of this IdpGroupMapping.
135        The OCID of the `IdpGroupMapping`.
136
137
138        :param id: The id of this IdpGroupMapping.
139        :type: str
140        """
141        self._id = id
142
143    @property
144    def idp_id(self):
145        """
146        **[Required]** Gets the idp_id of this IdpGroupMapping.
147        The OCID of the `IdentityProvider` this mapping belongs to.
148
149
150        :return: The idp_id of this IdpGroupMapping.
151        :rtype: str
152        """
153        return self._idp_id
154
155    @idp_id.setter
156    def idp_id(self, idp_id):
157        """
158        Sets the idp_id of this IdpGroupMapping.
159        The OCID of the `IdentityProvider` this mapping belongs to.
160
161
162        :param idp_id: The idp_id of this IdpGroupMapping.
163        :type: str
164        """
165        self._idp_id = idp_id
166
167    @property
168    def idp_group_name(self):
169        """
170        **[Required]** Gets the idp_group_name of this IdpGroupMapping.
171        The name of the IdP group that is mapped to the IAM Service group.
172
173
174        :return: The idp_group_name of this IdpGroupMapping.
175        :rtype: str
176        """
177        return self._idp_group_name
178
179    @idp_group_name.setter
180    def idp_group_name(self, idp_group_name):
181        """
182        Sets the idp_group_name of this IdpGroupMapping.
183        The name of the IdP group that is mapped to the IAM Service group.
184
185
186        :param idp_group_name: The idp_group_name of this IdpGroupMapping.
187        :type: str
188        """
189        self._idp_group_name = idp_group_name
190
191    @property
192    def group_id(self):
193        """
194        **[Required]** Gets the group_id of this IdpGroupMapping.
195        The OCID of the IAM Service group that is mapped to the IdP group.
196
197
198        :return: The group_id of this IdpGroupMapping.
199        :rtype: str
200        """
201        return self._group_id
202
203    @group_id.setter
204    def group_id(self, group_id):
205        """
206        Sets the group_id of this IdpGroupMapping.
207        The OCID of the IAM Service group that is mapped to the IdP group.
208
209
210        :param group_id: The group_id of this IdpGroupMapping.
211        :type: str
212        """
213        self._group_id = group_id
214
215    @property
216    def compartment_id(self):
217        """
218        **[Required]** Gets the compartment_id of this IdpGroupMapping.
219        The OCID of the tenancy containing the `IdentityProvider`.
220
221
222        :return: The compartment_id of this IdpGroupMapping.
223        :rtype: str
224        """
225        return self._compartment_id
226
227    @compartment_id.setter
228    def compartment_id(self, compartment_id):
229        """
230        Sets the compartment_id of this IdpGroupMapping.
231        The OCID of the tenancy containing the `IdentityProvider`.
232
233
234        :param compartment_id: The compartment_id of this IdpGroupMapping.
235        :type: str
236        """
237        self._compartment_id = compartment_id
238
239    @property
240    def time_created(self):
241        """
242        **[Required]** Gets the time_created of this IdpGroupMapping.
243        Date and time the mapping was created, in the format defined by RFC3339.
244
245        Example: `2016-08-25T21:10:29.600Z`
246
247
248        :return: The time_created of this IdpGroupMapping.
249        :rtype: datetime
250        """
251        return self._time_created
252
253    @time_created.setter
254    def time_created(self, time_created):
255        """
256        Sets the time_created of this IdpGroupMapping.
257        Date and time the mapping was created, in the format defined by RFC3339.
258
259        Example: `2016-08-25T21:10:29.600Z`
260
261
262        :param time_created: The time_created of this IdpGroupMapping.
263        :type: datetime
264        """
265        self._time_created = time_created
266
267    @property
268    def lifecycle_state(self):
269        """
270        **[Required]** Gets the lifecycle_state of this IdpGroupMapping.
271        The mapping's current state.  After creating a mapping object, make sure its `lifecycleState` changes
272        from CREATING to ACTIVE before using it.
273
274        Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", 'UNKNOWN_ENUM_VALUE'.
275        Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
276
277
278        :return: The lifecycle_state of this IdpGroupMapping.
279        :rtype: str
280        """
281        return self._lifecycle_state
282
283    @lifecycle_state.setter
284    def lifecycle_state(self, lifecycle_state):
285        """
286        Sets the lifecycle_state of this IdpGroupMapping.
287        The mapping's current state.  After creating a mapping object, make sure its `lifecycleState` changes
288        from CREATING to ACTIVE before using it.
289
290
291        :param lifecycle_state: The lifecycle_state of this IdpGroupMapping.
292        :type: str
293        """
294        allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED"]
295        if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values):
296            lifecycle_state = 'UNKNOWN_ENUM_VALUE'
297        self._lifecycle_state = lifecycle_state
298
299    @property
300    def inactive_status(self):
301        """
302        Gets the inactive_status of this IdpGroupMapping.
303        The detailed status of INACTIVE lifecycleState.
304
305
306        :return: The inactive_status of this IdpGroupMapping.
307        :rtype: int
308        """
309        return self._inactive_status
310
311    @inactive_status.setter
312    def inactive_status(self, inactive_status):
313        """
314        Sets the inactive_status of this IdpGroupMapping.
315        The detailed status of INACTIVE lifecycleState.
316
317
318        :param inactive_status: The inactive_status of this IdpGroupMapping.
319        :type: int
320        """
321        self._inactive_status = inactive_status
322
323    def __repr__(self):
324        return formatted_flat_dict(self)
325
326    def __eq__(self, other):
327        if other is None:
328            return False
329
330        return self.__dict__ == other.__dict__
331
332    def __ne__(self, other):
333        return not self == other
334