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 StreamSummary(object):
12    """
13    Summary representation of a stream.
14    """
15
16    #: A constant which can be used with the lifecycle_state property of a StreamSummary.
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 StreamSummary.
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 StreamSummary.
25    #: This constant has a value of "DELETING"
26    LIFECYCLE_STATE_DELETING = "DELETING"
27
28    #: A constant which can be used with the lifecycle_state property of a StreamSummary.
29    #: This constant has a value of "DELETED"
30    LIFECYCLE_STATE_DELETED = "DELETED"
31
32    #: A constant which can be used with the lifecycle_state property of a StreamSummary.
33    #: This constant has a value of "FAILED"
34    LIFECYCLE_STATE_FAILED = "FAILED"
35
36    #: A constant which can be used with the lifecycle_state property of a StreamSummary.
37    #: This constant has a value of "UPDATING"
38    LIFECYCLE_STATE_UPDATING = "UPDATING"
39
40    def __init__(self, **kwargs):
41        """
42        Initializes a new StreamSummary object with values from keyword arguments.
43        The following keyword arguments are supported (corresponding to the getters/setters of this class):
44
45        :param name:
46            The value to assign to the name property of this StreamSummary.
47        :type name: str
48
49        :param id:
50            The value to assign to the id property of this StreamSummary.
51        :type id: str
52
53        :param partitions:
54            The value to assign to the partitions property of this StreamSummary.
55        :type partitions: int
56
57        :param compartment_id:
58            The value to assign to the compartment_id property of this StreamSummary.
59        :type compartment_id: str
60
61        :param stream_pool_id:
62            The value to assign to the stream_pool_id property of this StreamSummary.
63        :type stream_pool_id: str
64
65        :param lifecycle_state:
66            The value to assign to the lifecycle_state property of this StreamSummary.
67            Allowed values for this property are: "CREATING", "ACTIVE", "DELETING", "DELETED", "FAILED", "UPDATING", 'UNKNOWN_ENUM_VALUE'.
68            Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
69        :type lifecycle_state: str
70
71        :param time_created:
72            The value to assign to the time_created property of this StreamSummary.
73        :type time_created: datetime
74
75        :param messages_endpoint:
76            The value to assign to the messages_endpoint property of this StreamSummary.
77        :type messages_endpoint: str
78
79        :param freeform_tags:
80            The value to assign to the freeform_tags property of this StreamSummary.
81        :type freeform_tags: dict(str, str)
82
83        :param defined_tags:
84            The value to assign to the defined_tags property of this StreamSummary.
85        :type defined_tags: dict(str, dict(str, object))
86
87        """
88        self.swagger_types = {
89            'name': 'str',
90            'id': 'str',
91            'partitions': 'int',
92            'compartment_id': 'str',
93            'stream_pool_id': 'str',
94            'lifecycle_state': 'str',
95            'time_created': 'datetime',
96            'messages_endpoint': 'str',
97            'freeform_tags': 'dict(str, str)',
98            'defined_tags': 'dict(str, dict(str, object))'
99        }
100
101        self.attribute_map = {
102            'name': 'name',
103            'id': 'id',
104            'partitions': 'partitions',
105            'compartment_id': 'compartmentId',
106            'stream_pool_id': 'streamPoolId',
107            'lifecycle_state': 'lifecycleState',
108            'time_created': 'timeCreated',
109            'messages_endpoint': 'messagesEndpoint',
110            'freeform_tags': 'freeformTags',
111            'defined_tags': 'definedTags'
112        }
113
114        self._name = None
115        self._id = None
116        self._partitions = None
117        self._compartment_id = None
118        self._stream_pool_id = None
119        self._lifecycle_state = None
120        self._time_created = None
121        self._messages_endpoint = None
122        self._freeform_tags = None
123        self._defined_tags = None
124
125    @property
126    def name(self):
127        """
128        **[Required]** Gets the name of this StreamSummary.
129        The name of the stream.
130
131        Example: `TelemetryEvents`
132
133
134        :return: The name of this StreamSummary.
135        :rtype: str
136        """
137        return self._name
138
139    @name.setter
140    def name(self, name):
141        """
142        Sets the name of this StreamSummary.
143        The name of the stream.
144
145        Example: `TelemetryEvents`
146
147
148        :param name: The name of this StreamSummary.
149        :type: str
150        """
151        self._name = name
152
153    @property
154    def id(self):
155        """
156        **[Required]** Gets the id of this StreamSummary.
157        The OCID of the stream.
158
159
160        :return: The id of this StreamSummary.
161        :rtype: str
162        """
163        return self._id
164
165    @id.setter
166    def id(self, id):
167        """
168        Sets the id of this StreamSummary.
169        The OCID of the stream.
170
171
172        :param id: The id of this StreamSummary.
173        :type: str
174        """
175        self._id = id
176
177    @property
178    def partitions(self):
179        """
180        **[Required]** Gets the partitions of this StreamSummary.
181        The number of partitions in the stream.
182
183
184        :return: The partitions of this StreamSummary.
185        :rtype: int
186        """
187        return self._partitions
188
189    @partitions.setter
190    def partitions(self, partitions):
191        """
192        Sets the partitions of this StreamSummary.
193        The number of partitions in the stream.
194
195
196        :param partitions: The partitions of this StreamSummary.
197        :type: int
198        """
199        self._partitions = partitions
200
201    @property
202    def compartment_id(self):
203        """
204        **[Required]** Gets the compartment_id of this StreamSummary.
205        The OCID of the compartment that contains the stream.
206
207
208        :return: The compartment_id of this StreamSummary.
209        :rtype: str
210        """
211        return self._compartment_id
212
213    @compartment_id.setter
214    def compartment_id(self, compartment_id):
215        """
216        Sets the compartment_id of this StreamSummary.
217        The OCID of the compartment that contains the stream.
218
219
220        :param compartment_id: The compartment_id of this StreamSummary.
221        :type: str
222        """
223        self._compartment_id = compartment_id
224
225    @property
226    def stream_pool_id(self):
227        """
228        **[Required]** Gets the stream_pool_id of this StreamSummary.
229        The OCID of the stream pool that contains the stream.
230
231
232        :return: The stream_pool_id of this StreamSummary.
233        :rtype: str
234        """
235        return self._stream_pool_id
236
237    @stream_pool_id.setter
238    def stream_pool_id(self, stream_pool_id):
239        """
240        Sets the stream_pool_id of this StreamSummary.
241        The OCID of the stream pool that contains the stream.
242
243
244        :param stream_pool_id: The stream_pool_id of this StreamSummary.
245        :type: str
246        """
247        self._stream_pool_id = stream_pool_id
248
249    @property
250    def lifecycle_state(self):
251        """
252        **[Required]** Gets the lifecycle_state of this StreamSummary.
253        The current state of the stream.
254
255        Allowed values for this property are: "CREATING", "ACTIVE", "DELETING", "DELETED", "FAILED", "UPDATING", 'UNKNOWN_ENUM_VALUE'.
256        Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
257
258
259        :return: The lifecycle_state of this StreamSummary.
260        :rtype: str
261        """
262        return self._lifecycle_state
263
264    @lifecycle_state.setter
265    def lifecycle_state(self, lifecycle_state):
266        """
267        Sets the lifecycle_state of this StreamSummary.
268        The current state of the stream.
269
270
271        :param lifecycle_state: The lifecycle_state of this StreamSummary.
272        :type: str
273        """
274        allowed_values = ["CREATING", "ACTIVE", "DELETING", "DELETED", "FAILED", "UPDATING"]
275        if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values):
276            lifecycle_state = 'UNKNOWN_ENUM_VALUE'
277        self._lifecycle_state = lifecycle_state
278
279    @property
280    def time_created(self):
281        """
282        **[Required]** Gets the time_created of this StreamSummary.
283        The date and time the stream was created, expressed in `RFC 3339`__ timestamp format.
284
285        Example: `2018-04-20T00:00:07.405Z`
286
287        __ https://tools.ietf.org/rfc/rfc3339
288
289
290        :return: The time_created of this StreamSummary.
291        :rtype: datetime
292        """
293        return self._time_created
294
295    @time_created.setter
296    def time_created(self, time_created):
297        """
298        Sets the time_created of this StreamSummary.
299        The date and time the stream was created, expressed in `RFC 3339`__ timestamp format.
300
301        Example: `2018-04-20T00:00:07.405Z`
302
303        __ https://tools.ietf.org/rfc/rfc3339
304
305
306        :param time_created: The time_created of this StreamSummary.
307        :type: datetime
308        """
309        self._time_created = time_created
310
311    @property
312    def messages_endpoint(self):
313        """
314        **[Required]** Gets the messages_endpoint of this StreamSummary.
315        The endpoint to use when creating the StreamClient to consume or publish messages in the stream.
316        If the associated stream pool is private, the endpoint is also private and can only be accessed from inside the stream pool's associated subnet.
317
318
319        :return: The messages_endpoint of this StreamSummary.
320        :rtype: str
321        """
322        return self._messages_endpoint
323
324    @messages_endpoint.setter
325    def messages_endpoint(self, messages_endpoint):
326        """
327        Sets the messages_endpoint of this StreamSummary.
328        The endpoint to use when creating the StreamClient to consume or publish messages in the stream.
329        If the associated stream pool is private, the endpoint is also private and can only be accessed from inside the stream pool's associated subnet.
330
331
332        :param messages_endpoint: The messages_endpoint of this StreamSummary.
333        :type: str
334        """
335        self._messages_endpoint = messages_endpoint
336
337    @property
338    def freeform_tags(self):
339        """
340        Gets the freeform_tags of this StreamSummary.
341        Free-form tags for this resource. Each tag is a simple key-value pair that is applied with no predefined name, type, or namespace. Exists for cross-compatibility only.
342        For more information, see `Resource Tags`__.
343
344        Example: `{\"Department\": \"Finance\"}`
345
346        __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm
347
348
349        :return: The freeform_tags of this StreamSummary.
350        :rtype: dict(str, str)
351        """
352        return self._freeform_tags
353
354    @freeform_tags.setter
355    def freeform_tags(self, freeform_tags):
356        """
357        Sets the freeform_tags of this StreamSummary.
358        Free-form tags for this resource. Each tag is a simple key-value pair that is applied with no predefined name, type, or namespace. Exists for cross-compatibility only.
359        For more information, see `Resource Tags`__.
360
361        Example: `{\"Department\": \"Finance\"}`
362
363        __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm
364
365
366        :param freeform_tags: The freeform_tags of this StreamSummary.
367        :type: dict(str, str)
368        """
369        self._freeform_tags = freeform_tags
370
371    @property
372    def defined_tags(self):
373        """
374        Gets the defined_tags of this StreamSummary.
375        Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see `Resource Tags`__.
376
377        Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
378
379        __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm
380
381
382        :return: The defined_tags of this StreamSummary.
383        :rtype: dict(str, dict(str, object))
384        """
385        return self._defined_tags
386
387    @defined_tags.setter
388    def defined_tags(self, defined_tags):
389        """
390        Sets the defined_tags of this StreamSummary.
391        Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see `Resource Tags`__.
392
393        Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
394
395        __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm
396
397
398        :param defined_tags: The defined_tags of this StreamSummary.
399        :type: dict(str, dict(str, object))
400        """
401        self._defined_tags = defined_tags
402
403    def __repr__(self):
404        return formatted_flat_dict(self)
405
406    def __eq__(self, other):
407        if other is None:
408            return False
409
410        return self.__dict__ == other.__dict__
411
412    def __ne__(self, other):
413        return not self == other
414