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 AutoScalingConfiguration(object):
12    """
13    The information about the autoscale configuration.
14    """
15
16    #: A constant which can be used with the lifecycle_state property of a AutoScalingConfiguration.
17    #: This constant has a value of "CREATING"
18    LIFECYCLE_STATE_CREATING = "CREATING"
19
20    #: A constant which can be used with the lifecycle_state property of a AutoScalingConfiguration.
21    #: This constant has a value of "ACTIVE"
22    LIFECYCLE_STATE_ACTIVE = "ACTIVE"
23
24    #: A constant which can be used with the lifecycle_state property of a AutoScalingConfiguration.
25    #: This constant has a value of "UPDATING"
26    LIFECYCLE_STATE_UPDATING = "UPDATING"
27
28    #: A constant which can be used with the lifecycle_state property of a AutoScalingConfiguration.
29    #: This constant has a value of "DELETING"
30    LIFECYCLE_STATE_DELETING = "DELETING"
31
32    #: A constant which can be used with the lifecycle_state property of a AutoScalingConfiguration.
33    #: This constant has a value of "DELETED"
34    LIFECYCLE_STATE_DELETED = "DELETED"
35
36    #: A constant which can be used with the lifecycle_state property of a AutoScalingConfiguration.
37    #: This constant has a value of "FAILED"
38    LIFECYCLE_STATE_FAILED = "FAILED"
39
40    def __init__(self, **kwargs):
41        """
42        Initializes a new AutoScalingConfiguration object with values from keyword arguments.
43        The following keyword arguments are supported (corresponding to the getters/setters of this class):
44
45        :param id:
46            The value to assign to the id property of this AutoScalingConfiguration.
47        :type id: str
48
49        :param display_name:
50            The value to assign to the display_name property of this AutoScalingConfiguration.
51        :type display_name: str
52
53        :param node_type:
54            The value to assign to the node_type property of this AutoScalingConfiguration.
55        :type node_type: str
56
57        :param lifecycle_state:
58            The value to assign to the lifecycle_state property of this AutoScalingConfiguration.
59            Allowed values for this property are: "CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'.
60            Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
61        :type lifecycle_state: str
62
63        :param time_created:
64            The value to assign to the time_created property of this AutoScalingConfiguration.
65        :type time_created: datetime
66
67        :param time_updated:
68            The value to assign to the time_updated property of this AutoScalingConfiguration.
69        :type time_updated: datetime
70
71        :param policy:
72            The value to assign to the policy property of this AutoScalingConfiguration.
73        :type policy: oci.bds.models.AutoScalePolicy
74
75        """
76        self.swagger_types = {
77            'id': 'str',
78            'display_name': 'str',
79            'node_type': 'str',
80            'lifecycle_state': 'str',
81            'time_created': 'datetime',
82            'time_updated': 'datetime',
83            'policy': 'AutoScalePolicy'
84        }
85
86        self.attribute_map = {
87            'id': 'id',
88            'display_name': 'displayName',
89            'node_type': 'nodeType',
90            'lifecycle_state': 'lifecycleState',
91            'time_created': 'timeCreated',
92            'time_updated': 'timeUpdated',
93            'policy': 'policy'
94        }
95
96        self._id = None
97        self._display_name = None
98        self._node_type = None
99        self._lifecycle_state = None
100        self._time_created = None
101        self._time_updated = None
102        self._policy = None
103
104    @property
105    def id(self):
106        """
107        **[Required]** Gets the id of this AutoScalingConfiguration.
108        The unique identifier for the autoscale configuration.
109
110
111        :return: The id of this AutoScalingConfiguration.
112        :rtype: str
113        """
114        return self._id
115
116    @id.setter
117    def id(self, id):
118        """
119        Sets the id of this AutoScalingConfiguration.
120        The unique identifier for the autoscale configuration.
121
122
123        :param id: The id of this AutoScalingConfiguration.
124        :type: str
125        """
126        self._id = id
127
128    @property
129    def display_name(self):
130        """
131        **[Required]** Gets the display_name of this AutoScalingConfiguration.
132        A user-friendly name. The name does not have to be unique, and it may be changed. Avoid entering confidential information.
133
134
135        :return: The display_name of this AutoScalingConfiguration.
136        :rtype: str
137        """
138        return self._display_name
139
140    @display_name.setter
141    def display_name(self, display_name):
142        """
143        Sets the display_name of this AutoScalingConfiguration.
144        A user-friendly name. The name does not have to be unique, and it may be changed. Avoid entering confidential information.
145
146
147        :param display_name: The display_name of this AutoScalingConfiguration.
148        :type: str
149        """
150        self._display_name = display_name
151
152    @property
153    def node_type(self):
154        """
155        **[Required]** Gets the node_type of this AutoScalingConfiguration.
156        A node type that is managed by an autoscale configuration. The only supported type is WORKER.
157
158
159        :return: The node_type of this AutoScalingConfiguration.
160        :rtype: str
161        """
162        return self._node_type
163
164    @node_type.setter
165    def node_type(self, node_type):
166        """
167        Sets the node_type of this AutoScalingConfiguration.
168        A node type that is managed by an autoscale configuration. The only supported type is WORKER.
169
170
171        :param node_type: The node_type of this AutoScalingConfiguration.
172        :type: str
173        """
174        self._node_type = node_type
175
176    @property
177    def lifecycle_state(self):
178        """
179        **[Required]** Gets the lifecycle_state of this AutoScalingConfiguration.
180        The state of the autoscale configuration.
181
182        Allowed values for this property are: "CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'.
183        Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
184
185
186        :return: The lifecycle_state of this AutoScalingConfiguration.
187        :rtype: str
188        """
189        return self._lifecycle_state
190
191    @lifecycle_state.setter
192    def lifecycle_state(self, lifecycle_state):
193        """
194        Sets the lifecycle_state of this AutoScalingConfiguration.
195        The state of the autoscale configuration.
196
197
198        :param lifecycle_state: The lifecycle_state of this AutoScalingConfiguration.
199        :type: str
200        """
201        allowed_values = ["CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"]
202        if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values):
203            lifecycle_state = 'UNKNOWN_ENUM_VALUE'
204        self._lifecycle_state = lifecycle_state
205
206    @property
207    def time_created(self):
208        """
209        **[Required]** Gets the time_created of this AutoScalingConfiguration.
210        The time the cluster was created, shown as an RFC 3339 formatted datetime string.
211
212
213        :return: The time_created of this AutoScalingConfiguration.
214        :rtype: datetime
215        """
216        return self._time_created
217
218    @time_created.setter
219    def time_created(self, time_created):
220        """
221        Sets the time_created of this AutoScalingConfiguration.
222        The time the cluster was created, shown as an RFC 3339 formatted datetime string.
223
224
225        :param time_created: The time_created of this AutoScalingConfiguration.
226        :type: datetime
227        """
228        self._time_created = time_created
229
230    @property
231    def time_updated(self):
232        """
233        **[Required]** Gets the time_updated of this AutoScalingConfiguration.
234        The time the autoscale configuration was updated, shown as an RFC 3339 formatted datetime string.
235
236
237        :return: The time_updated of this AutoScalingConfiguration.
238        :rtype: datetime
239        """
240        return self._time_updated
241
242    @time_updated.setter
243    def time_updated(self, time_updated):
244        """
245        Sets the time_updated of this AutoScalingConfiguration.
246        The time the autoscale configuration was updated, shown as an RFC 3339 formatted datetime string.
247
248
249        :param time_updated: The time_updated of this AutoScalingConfiguration.
250        :type: datetime
251        """
252        self._time_updated = time_updated
253
254    @property
255    def policy(self):
256        """
257        **[Required]** Gets the policy of this AutoScalingConfiguration.
258
259        :return: The policy of this AutoScalingConfiguration.
260        :rtype: oci.bds.models.AutoScalePolicy
261        """
262        return self._policy
263
264    @policy.setter
265    def policy(self, policy):
266        """
267        Sets the policy of this AutoScalingConfiguration.
268
269        :param policy: The policy of this AutoScalingConfiguration.
270        :type: oci.bds.models.AutoScalePolicy
271        """
272        self._policy = policy
273
274    def __repr__(self):
275        return formatted_flat_dict(self)
276
277    def __eq__(self, other):
278        if other is None:
279            return False
280
281        return self.__dict__ == other.__dict__
282
283    def __ne__(self, other):
284        return not self == other
285