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 HistorySummary(object):
12    """
13    The metadata associated with the recommendation history and its related resources.
14    """
15
16    #: A constant which can be used with the lifecycle_state property of a HistorySummary.
17    #: This constant has a value of "ACTIVE"
18    LIFECYCLE_STATE_ACTIVE = "ACTIVE"
19
20    #: A constant which can be used with the lifecycle_state property of a HistorySummary.
21    #: This constant has a value of "FAILED"
22    LIFECYCLE_STATE_FAILED = "FAILED"
23
24    #: A constant which can be used with the lifecycle_state property of a HistorySummary.
25    #: This constant has a value of "INACTIVE"
26    LIFECYCLE_STATE_INACTIVE = "INACTIVE"
27
28    #: A constant which can be used with the lifecycle_state property of a HistorySummary.
29    #: This constant has a value of "ATTACHING"
30    LIFECYCLE_STATE_ATTACHING = "ATTACHING"
31
32    #: A constant which can be used with the lifecycle_state property of a HistorySummary.
33    #: This constant has a value of "DETACHING"
34    LIFECYCLE_STATE_DETACHING = "DETACHING"
35
36    #: A constant which can be used with the lifecycle_state property of a HistorySummary.
37    #: This constant has a value of "DELETING"
38    LIFECYCLE_STATE_DELETING = "DELETING"
39
40    #: A constant which can be used with the lifecycle_state property of a HistorySummary.
41    #: This constant has a value of "DELETED"
42    LIFECYCLE_STATE_DELETED = "DELETED"
43
44    #: A constant which can be used with the lifecycle_state property of a HistorySummary.
45    #: This constant has a value of "UPDATING"
46    LIFECYCLE_STATE_UPDATING = "UPDATING"
47
48    #: A constant which can be used with the lifecycle_state property of a HistorySummary.
49    #: This constant has a value of "CREATING"
50    LIFECYCLE_STATE_CREATING = "CREATING"
51
52    #: A constant which can be used with the status property of a HistorySummary.
53    #: This constant has a value of "PENDING"
54    STATUS_PENDING = "PENDING"
55
56    #: A constant which can be used with the status property of a HistorySummary.
57    #: This constant has a value of "DISMISSED"
58    STATUS_DISMISSED = "DISMISSED"
59
60    #: A constant which can be used with the status property of a HistorySummary.
61    #: This constant has a value of "POSTPONED"
62    STATUS_POSTPONED = "POSTPONED"
63
64    #: A constant which can be used with the status property of a HistorySummary.
65    #: This constant has a value of "IMPLEMENTED"
66    STATUS_IMPLEMENTED = "IMPLEMENTED"
67
68    def __init__(self, **kwargs):
69        """
70        Initializes a new HistorySummary object with values from keyword arguments.
71        The following keyword arguments are supported (corresponding to the getters/setters of this class):
72
73        :param id:
74            The value to assign to the id property of this HistorySummary.
75        :type id: str
76
77        :param name:
78            The value to assign to the name property of this HistorySummary.
79        :type name: str
80
81        :param resource_type:
82            The value to assign to the resource_type property of this HistorySummary.
83        :type resource_type: str
84
85        :param category_id:
86            The value to assign to the category_id property of this HistorySummary.
87        :type category_id: str
88
89        :param recommendation_id:
90            The value to assign to the recommendation_id property of this HistorySummary.
91        :type recommendation_id: str
92
93        :param recommendation_name:
94            The value to assign to the recommendation_name property of this HistorySummary.
95        :type recommendation_name: str
96
97        :param resource_id:
98            The value to assign to the resource_id property of this HistorySummary.
99        :type resource_id: str
100
101        :param resource_action_id:
102            The value to assign to the resource_action_id property of this HistorySummary.
103        :type resource_action_id: str
104
105        :param action:
106            The value to assign to the action property of this HistorySummary.
107        :type action: oci.optimizer.models.Action
108
109        :param compartment_id:
110            The value to assign to the compartment_id property of this HistorySummary.
111        :type compartment_id: str
112
113        :param compartment_name:
114            The value to assign to the compartment_name property of this HistorySummary.
115        :type compartment_name: str
116
117        :param lifecycle_state:
118            The value to assign to the lifecycle_state property of this HistorySummary.
119            Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'.
120            Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
121        :type lifecycle_state: str
122
123        :param estimated_cost_saving:
124            The value to assign to the estimated_cost_saving property of this HistorySummary.
125        :type estimated_cost_saving: float
126
127        :param status:
128            The value to assign to the status property of this HistorySummary.
129            Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED", 'UNKNOWN_ENUM_VALUE'.
130            Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
131        :type status: str
132
133        :param metadata:
134            The value to assign to the metadata property of this HistorySummary.
135        :type metadata: dict(str, str)
136
137        :param extended_metadata:
138            The value to assign to the extended_metadata property of this HistorySummary.
139        :type extended_metadata: dict(str, object)
140
141        :param time_created:
142            The value to assign to the time_created property of this HistorySummary.
143        :type time_created: datetime
144
145        """
146        self.swagger_types = {
147            'id': 'str',
148            'name': 'str',
149            'resource_type': 'str',
150            'category_id': 'str',
151            'recommendation_id': 'str',
152            'recommendation_name': 'str',
153            'resource_id': 'str',
154            'resource_action_id': 'str',
155            'action': 'Action',
156            'compartment_id': 'str',
157            'compartment_name': 'str',
158            'lifecycle_state': 'str',
159            'estimated_cost_saving': 'float',
160            'status': 'str',
161            'metadata': 'dict(str, str)',
162            'extended_metadata': 'dict(str, object)',
163            'time_created': 'datetime'
164        }
165
166        self.attribute_map = {
167            'id': 'id',
168            'name': 'name',
169            'resource_type': 'resourceType',
170            'category_id': 'categoryId',
171            'recommendation_id': 'recommendationId',
172            'recommendation_name': 'recommendationName',
173            'resource_id': 'resourceId',
174            'resource_action_id': 'resourceActionId',
175            'action': 'action',
176            'compartment_id': 'compartmentId',
177            'compartment_name': 'compartmentName',
178            'lifecycle_state': 'lifecycleState',
179            'estimated_cost_saving': 'estimatedCostSaving',
180            'status': 'status',
181            'metadata': 'metadata',
182            'extended_metadata': 'extendedMetadata',
183            'time_created': 'timeCreated'
184        }
185
186        self._id = None
187        self._name = None
188        self._resource_type = None
189        self._category_id = None
190        self._recommendation_id = None
191        self._recommendation_name = None
192        self._resource_id = None
193        self._resource_action_id = None
194        self._action = None
195        self._compartment_id = None
196        self._compartment_name = None
197        self._lifecycle_state = None
198        self._estimated_cost_saving = None
199        self._status = None
200        self._metadata = None
201        self._extended_metadata = None
202        self._time_created = None
203
204    @property
205    def id(self):
206        """
207        **[Required]** Gets the id of this HistorySummary.
208        The unique OCID associated with the recommendation history.
209
210
211        :return: The id of this HistorySummary.
212        :rtype: str
213        """
214        return self._id
215
216    @id.setter
217    def id(self, id):
218        """
219        Sets the id of this HistorySummary.
220        The unique OCID associated with the recommendation history.
221
222
223        :param id: The id of this HistorySummary.
224        :type: str
225        """
226        self._id = id
227
228    @property
229    def name(self):
230        """
231        **[Required]** Gets the name of this HistorySummary.
232        The name assigned to the resource.
233
234
235        :return: The name of this HistorySummary.
236        :rtype: str
237        """
238        return self._name
239
240    @name.setter
241    def name(self, name):
242        """
243        Sets the name of this HistorySummary.
244        The name assigned to the resource.
245
246
247        :param name: The name of this HistorySummary.
248        :type: str
249        """
250        self._name = name
251
252    @property
253    def resource_type(self):
254        """
255        **[Required]** Gets the resource_type of this HistorySummary.
256        The kind of resource.
257
258
259        :return: The resource_type of this HistorySummary.
260        :rtype: str
261        """
262        return self._resource_type
263
264    @resource_type.setter
265    def resource_type(self, resource_type):
266        """
267        Sets the resource_type of this HistorySummary.
268        The kind of resource.
269
270
271        :param resource_type: The resource_type of this HistorySummary.
272        :type: str
273        """
274        self._resource_type = resource_type
275
276    @property
277    def category_id(self):
278        """
279        **[Required]** Gets the category_id of this HistorySummary.
280        The unique OCID associated with the category.
281
282
283        :return: The category_id of this HistorySummary.
284        :rtype: str
285        """
286        return self._category_id
287
288    @category_id.setter
289    def category_id(self, category_id):
290        """
291        Sets the category_id of this HistorySummary.
292        The unique OCID associated with the category.
293
294
295        :param category_id: The category_id of this HistorySummary.
296        :type: str
297        """
298        self._category_id = category_id
299
300    @property
301    def recommendation_id(self):
302        """
303        **[Required]** Gets the recommendation_id of this HistorySummary.
304        The unique OCID associated with the recommendation.
305
306
307        :return: The recommendation_id of this HistorySummary.
308        :rtype: str
309        """
310        return self._recommendation_id
311
312    @recommendation_id.setter
313    def recommendation_id(self, recommendation_id):
314        """
315        Sets the recommendation_id of this HistorySummary.
316        The unique OCID associated with the recommendation.
317
318
319        :param recommendation_id: The recommendation_id of this HistorySummary.
320        :type: str
321        """
322        self._recommendation_id = recommendation_id
323
324    @property
325    def recommendation_name(self):
326        """
327        **[Required]** Gets the recommendation_name of this HistorySummary.
328        The name assigned to the recommendation.
329
330
331        :return: The recommendation_name of this HistorySummary.
332        :rtype: str
333        """
334        return self._recommendation_name
335
336    @recommendation_name.setter
337    def recommendation_name(self, recommendation_name):
338        """
339        Sets the recommendation_name of this HistorySummary.
340        The name assigned to the recommendation.
341
342
343        :param recommendation_name: The recommendation_name of this HistorySummary.
344        :type: str
345        """
346        self._recommendation_name = recommendation_name
347
348    @property
349    def resource_id(self):
350        """
351        **[Required]** Gets the resource_id of this HistorySummary.
352        The unique OCID associated with the resource.
353
354
355        :return: The resource_id of this HistorySummary.
356        :rtype: str
357        """
358        return self._resource_id
359
360    @resource_id.setter
361    def resource_id(self, resource_id):
362        """
363        Sets the resource_id of this HistorySummary.
364        The unique OCID associated with the resource.
365
366
367        :param resource_id: The resource_id of this HistorySummary.
368        :type: str
369        """
370        self._resource_id = resource_id
371
372    @property
373    def resource_action_id(self):
374        """
375        **[Required]** Gets the resource_action_id of this HistorySummary.
376        The unique OCID associated with the resource action.
377
378
379        :return: The resource_action_id of this HistorySummary.
380        :rtype: str
381        """
382        return self._resource_action_id
383
384    @resource_action_id.setter
385    def resource_action_id(self, resource_action_id):
386        """
387        Sets the resource_action_id of this HistorySummary.
388        The unique OCID associated with the resource action.
389
390
391        :param resource_action_id: The resource_action_id of this HistorySummary.
392        :type: str
393        """
394        self._resource_action_id = resource_action_id
395
396    @property
397    def action(self):
398        """
399        **[Required]** Gets the action of this HistorySummary.
400
401        :return: The action of this HistorySummary.
402        :rtype: oci.optimizer.models.Action
403        """
404        return self._action
405
406    @action.setter
407    def action(self, action):
408        """
409        Sets the action of this HistorySummary.
410
411        :param action: The action of this HistorySummary.
412        :type: oci.optimizer.models.Action
413        """
414        self._action = action
415
416    @property
417    def compartment_id(self):
418        """
419        **[Required]** Gets the compartment_id of this HistorySummary.
420        The OCID of the compartment.
421
422
423        :return: The compartment_id of this HistorySummary.
424        :rtype: str
425        """
426        return self._compartment_id
427
428    @compartment_id.setter
429    def compartment_id(self, compartment_id):
430        """
431        Sets the compartment_id of this HistorySummary.
432        The OCID of the compartment.
433
434
435        :param compartment_id: The compartment_id of this HistorySummary.
436        :type: str
437        """
438        self._compartment_id = compartment_id
439
440    @property
441    def compartment_name(self):
442        """
443        **[Required]** Gets the compartment_name of this HistorySummary.
444        The name assigned to the compartment.
445
446
447        :return: The compartment_name of this HistorySummary.
448        :rtype: str
449        """
450        return self._compartment_name
451
452    @compartment_name.setter
453    def compartment_name(self, compartment_name):
454        """
455        Sets the compartment_name of this HistorySummary.
456        The name assigned to the compartment.
457
458
459        :param compartment_name: The compartment_name of this HistorySummary.
460        :type: str
461        """
462        self._compartment_name = compartment_name
463
464    @property
465    def lifecycle_state(self):
466        """
467        **[Required]** Gets the lifecycle_state of this HistorySummary.
468        The recommendation history's current state.
469
470        Allowed values for this property are: "ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING", 'UNKNOWN_ENUM_VALUE'.
471        Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
472
473
474        :return: The lifecycle_state of this HistorySummary.
475        :rtype: str
476        """
477        return self._lifecycle_state
478
479    @lifecycle_state.setter
480    def lifecycle_state(self, lifecycle_state):
481        """
482        Sets the lifecycle_state of this HistorySummary.
483        The recommendation history's current state.
484
485
486        :param lifecycle_state: The lifecycle_state of this HistorySummary.
487        :type: str
488        """
489        allowed_values = ["ACTIVE", "FAILED", "INACTIVE", "ATTACHING", "DETACHING", "DELETING", "DELETED", "UPDATING", "CREATING"]
490        if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values):
491            lifecycle_state = 'UNKNOWN_ENUM_VALUE'
492        self._lifecycle_state = lifecycle_state
493
494    @property
495    def estimated_cost_saving(self):
496        """
497        **[Required]** Gets the estimated_cost_saving of this HistorySummary.
498        The estimated cost savings, in dollars, for the resource action.
499
500
501        :return: The estimated_cost_saving of this HistorySummary.
502        :rtype: float
503        """
504        return self._estimated_cost_saving
505
506    @estimated_cost_saving.setter
507    def estimated_cost_saving(self, estimated_cost_saving):
508        """
509        Sets the estimated_cost_saving of this HistorySummary.
510        The estimated cost savings, in dollars, for the resource action.
511
512
513        :param estimated_cost_saving: The estimated_cost_saving of this HistorySummary.
514        :type: float
515        """
516        self._estimated_cost_saving = estimated_cost_saving
517
518    @property
519    def status(self):
520        """
521        **[Required]** Gets the status of this HistorySummary.
522        The current status of the resource action.
523
524        Allowed values for this property are: "PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED", 'UNKNOWN_ENUM_VALUE'.
525        Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
526
527
528        :return: The status of this HistorySummary.
529        :rtype: str
530        """
531        return self._status
532
533    @status.setter
534    def status(self, status):
535        """
536        Sets the status of this HistorySummary.
537        The current status of the resource action.
538
539
540        :param status: The status of this HistorySummary.
541        :type: str
542        """
543        allowed_values = ["PENDING", "DISMISSED", "POSTPONED", "IMPLEMENTED"]
544        if not value_allowed_none_or_none_sentinel(status, allowed_values):
545            status = 'UNKNOWN_ENUM_VALUE'
546        self._status = status
547
548    @property
549    def metadata(self):
550        """
551        Gets the metadata of this HistorySummary.
552        Custom metadata key/value pairs for the resource action.
553
554         **Metadata Example**
555
556              \"metadata\" : {
557                 \"cpuRecommendedShape\": \"VM.Standard1.1\",
558                 \"computeMemoryUtilization\": \"26.05734124418388\",
559                 \"currentShape\": \"VM.Standard1.2\",
560                 \"instanceRecommendedShape\": \"VM.Standard1.1\",
561                 \"computeCpuUtilization\": \"7.930035319720132\",
562                 \"memoryRecommendedShape\": \"None\"
563              }
564
565
566        :return: The metadata of this HistorySummary.
567        :rtype: dict(str, str)
568        """
569        return self._metadata
570
571    @metadata.setter
572    def metadata(self, metadata):
573        """
574        Sets the metadata of this HistorySummary.
575        Custom metadata key/value pairs for the resource action.
576
577         **Metadata Example**
578
579              \"metadata\" : {
580                 \"cpuRecommendedShape\": \"VM.Standard1.1\",
581                 \"computeMemoryUtilization\": \"26.05734124418388\",
582                 \"currentShape\": \"VM.Standard1.2\",
583                 \"instanceRecommendedShape\": \"VM.Standard1.1\",
584                 \"computeCpuUtilization\": \"7.930035319720132\",
585                 \"memoryRecommendedShape\": \"None\"
586              }
587
588
589        :param metadata: The metadata of this HistorySummary.
590        :type: dict(str, str)
591        """
592        self._metadata = metadata
593
594    @property
595    def extended_metadata(self):
596        """
597        Gets the extended_metadata of this HistorySummary.
598        Additional metadata key/value pairs that you provide.
599        They serve the same purpose and functionality as fields in the `metadata` object.
600
601        They are distinguished from `metadata` fields in that these can be nested JSON objects (whereas `metadata` fields are string/string maps only).
602
603        For example:
604
605        `{\"CurrentShape\": {\"name\":\"VM.Standard2.16\"}, \"RecommendedShape\": {\"name\":\"VM.Standard2.8\"}}`
606
607
608        :return: The extended_metadata of this HistorySummary.
609        :rtype: dict(str, object)
610        """
611        return self._extended_metadata
612
613    @extended_metadata.setter
614    def extended_metadata(self, extended_metadata):
615        """
616        Sets the extended_metadata of this HistorySummary.
617        Additional metadata key/value pairs that you provide.
618        They serve the same purpose and functionality as fields in the `metadata` object.
619
620        They are distinguished from `metadata` fields in that these can be nested JSON objects (whereas `metadata` fields are string/string maps only).
621
622        For example:
623
624        `{\"CurrentShape\": {\"name\":\"VM.Standard2.16\"}, \"RecommendedShape\": {\"name\":\"VM.Standard2.8\"}}`
625
626
627        :param extended_metadata: The extended_metadata of this HistorySummary.
628        :type: dict(str, object)
629        """
630        self._extended_metadata = extended_metadata
631
632    @property
633    def time_created(self):
634        """
635        Gets the time_created of this HistorySummary.
636        The date and time the recommendation history was created, in the format defined by RFC3339.
637
638
639        :return: The time_created of this HistorySummary.
640        :rtype: datetime
641        """
642        return self._time_created
643
644    @time_created.setter
645    def time_created(self, time_created):
646        """
647        Sets the time_created of this HistorySummary.
648        The date and time the recommendation history was created, in the format defined by RFC3339.
649
650
651        :param time_created: The time_created of this HistorySummary.
652        :type: datetime
653        """
654        self._time_created = time_created
655
656    def __repr__(self):
657        return formatted_flat_dict(self)
658
659    def __eq__(self, other):
660        if other is None:
661            return False
662
663        return self.__dict__ == other.__dict__
664
665    def __ne__(self, other):
666        return not self == other
667