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 ListingPackage(object): 12 """ 13 A base object for all types of listing packages. 14 """ 15 16 #: A constant which can be used with the package_type property of a ListingPackage. 17 #: This constant has a value of "ORCHESTRATION" 18 PACKAGE_TYPE_ORCHESTRATION = "ORCHESTRATION" 19 20 #: A constant which can be used with the package_type property of a ListingPackage. 21 #: This constant has a value of "IMAGE" 22 PACKAGE_TYPE_IMAGE = "IMAGE" 23 24 def __init__(self, **kwargs): 25 """ 26 Initializes a new ListingPackage object with values from keyword arguments. This class has the following subclasses and if you are using this class as input 27 to a service operations then you should favor using a subclass over the base class: 28 29 * :class:`~oci.marketplace.models.OrchestrationListingPackage` 30 * :class:`~oci.marketplace.models.ImageListingPackage` 31 32 The following keyword arguments are supported (corresponding to the getters/setters of this class): 33 34 :param description: 35 The value to assign to the description property of this ListingPackage. 36 :type description: str 37 38 :param listing_id: 39 The value to assign to the listing_id property of this ListingPackage. 40 :type listing_id: str 41 42 :param version: 43 The value to assign to the version property of this ListingPackage. 44 :type version: str 45 46 :param package_type: 47 The value to assign to the package_type property of this ListingPackage. 48 Allowed values for this property are: "ORCHESTRATION", "IMAGE", 'UNKNOWN_ENUM_VALUE'. 49 Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. 50 :type package_type: str 51 52 :param pricing: 53 The value to assign to the pricing property of this ListingPackage. 54 :type pricing: oci.marketplace.models.PricingModel 55 56 :param resource_id: 57 The value to assign to the resource_id property of this ListingPackage. 58 :type resource_id: str 59 60 :param time_created: 61 The value to assign to the time_created property of this ListingPackage. 62 :type time_created: datetime 63 64 :param operating_system: 65 The value to assign to the operating_system property of this ListingPackage. 66 :type operating_system: oci.marketplace.models.OperatingSystem 67 68 """ 69 self.swagger_types = { 70 'description': 'str', 71 'listing_id': 'str', 72 'version': 'str', 73 'package_type': 'str', 74 'pricing': 'PricingModel', 75 'resource_id': 'str', 76 'time_created': 'datetime', 77 'operating_system': 'OperatingSystem' 78 } 79 80 self.attribute_map = { 81 'description': 'description', 82 'listing_id': 'listingId', 83 'version': 'version', 84 'package_type': 'packageType', 85 'pricing': 'pricing', 86 'resource_id': 'resourceId', 87 'time_created': 'timeCreated', 88 'operating_system': 'operatingSystem' 89 } 90 91 self._description = None 92 self._listing_id = None 93 self._version = None 94 self._package_type = None 95 self._pricing = None 96 self._resource_id = None 97 self._time_created = None 98 self._operating_system = None 99 100 @staticmethod 101 def get_subtype(object_dictionary): 102 """ 103 Given the hash representation of a subtype of this class, 104 use the info in the hash to return the class of the subtype. 105 """ 106 type = object_dictionary['packageType'] 107 108 if type == 'ORCHESTRATION': 109 return 'OrchestrationListingPackage' 110 111 if type == 'IMAGE': 112 return 'ImageListingPackage' 113 else: 114 return 'ListingPackage' 115 116 @property 117 def description(self): 118 """ 119 Gets the description of this ListingPackage. 120 Description of this package. 121 122 123 :return: The description of this ListingPackage. 124 :rtype: str 125 """ 126 return self._description 127 128 @description.setter 129 def description(self, description): 130 """ 131 Sets the description of this ListingPackage. 132 Description of this package. 133 134 135 :param description: The description of this ListingPackage. 136 :type: str 137 """ 138 self._description = description 139 140 @property 141 def listing_id(self): 142 """ 143 **[Required]** Gets the listing_id of this ListingPackage. 144 The ID of the listing this package belongs to. 145 146 147 :return: The listing_id of this ListingPackage. 148 :rtype: str 149 """ 150 return self._listing_id 151 152 @listing_id.setter 153 def listing_id(self, listing_id): 154 """ 155 Sets the listing_id of this ListingPackage. 156 The ID of the listing this package belongs to. 157 158 159 :param listing_id: The listing_id of this ListingPackage. 160 :type: str 161 """ 162 self._listing_id = listing_id 163 164 @property 165 def version(self): 166 """ 167 **[Required]** Gets the version of this ListingPackage. 168 The package version. 169 170 171 :return: The version of this ListingPackage. 172 :rtype: str 173 """ 174 return self._version 175 176 @version.setter 177 def version(self, version): 178 """ 179 Sets the version of this ListingPackage. 180 The package version. 181 182 183 :param version: The version of this ListingPackage. 184 :type: str 185 """ 186 self._version = version 187 188 @property 189 def package_type(self): 190 """ 191 **[Required]** Gets the package_type of this ListingPackage. 192 The specified package's type. 193 194 Allowed values for this property are: "ORCHESTRATION", "IMAGE", 'UNKNOWN_ENUM_VALUE'. 195 Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. 196 197 198 :return: The package_type of this ListingPackage. 199 :rtype: str 200 """ 201 return self._package_type 202 203 @package_type.setter 204 def package_type(self, package_type): 205 """ 206 Sets the package_type of this ListingPackage. 207 The specified package's type. 208 209 210 :param package_type: The package_type of this ListingPackage. 211 :type: str 212 """ 213 allowed_values = ["ORCHESTRATION", "IMAGE"] 214 if not value_allowed_none_or_none_sentinel(package_type, allowed_values): 215 package_type = 'UNKNOWN_ENUM_VALUE' 216 self._package_type = package_type 217 218 @property 219 def pricing(self): 220 """ 221 Gets the pricing of this ListingPackage. 222 223 :return: The pricing of this ListingPackage. 224 :rtype: oci.marketplace.models.PricingModel 225 """ 226 return self._pricing 227 228 @pricing.setter 229 def pricing(self, pricing): 230 """ 231 Sets the pricing of this ListingPackage. 232 233 :param pricing: The pricing of this ListingPackage. 234 :type: oci.marketplace.models.PricingModel 235 """ 236 self._pricing = pricing 237 238 @property 239 def resource_id(self): 240 """ 241 Gets the resource_id of this ListingPackage. 242 The unique identifier for the package resource. 243 244 245 :return: The resource_id of this ListingPackage. 246 :rtype: str 247 """ 248 return self._resource_id 249 250 @resource_id.setter 251 def resource_id(self, resource_id): 252 """ 253 Sets the resource_id of this ListingPackage. 254 The unique identifier for the package resource. 255 256 257 :param resource_id: The resource_id of this ListingPackage. 258 :type: str 259 """ 260 self._resource_id = resource_id 261 262 @property 263 def time_created(self): 264 """ 265 Gets the time_created of this ListingPackage. 266 The date and time this listing package was created, expressed in `RFC 3339`__ 267 timestamp format. 268 269 Example: `2016-08-25T21:10:29.600Z` 270 271 __ https://tools.ietf.org/html/rfc3339 272 273 274 :return: The time_created of this ListingPackage. 275 :rtype: datetime 276 """ 277 return self._time_created 278 279 @time_created.setter 280 def time_created(self, time_created): 281 """ 282 Sets the time_created of this ListingPackage. 283 The date and time this listing package was created, expressed in `RFC 3339`__ 284 timestamp format. 285 286 Example: `2016-08-25T21:10:29.600Z` 287 288 __ https://tools.ietf.org/html/rfc3339 289 290 291 :param time_created: The time_created of this ListingPackage. 292 :type: datetime 293 """ 294 self._time_created = time_created 295 296 @property 297 def operating_system(self): 298 """ 299 Gets the operating_system of this ListingPackage. 300 301 :return: The operating_system of this ListingPackage. 302 :rtype: oci.marketplace.models.OperatingSystem 303 """ 304 return self._operating_system 305 306 @operating_system.setter 307 def operating_system(self, operating_system): 308 """ 309 Sets the operating_system of this ListingPackage. 310 311 :param operating_system: The operating_system of this ListingPackage. 312 :type: oci.marketplace.models.OperatingSystem 313 """ 314 self._operating_system = operating_system 315 316 def __repr__(self): 317 return formatted_flat_dict(self) 318 319 def __eq__(self, other): 320 if other is None: 321 return False 322 323 return self.__dict__ == other.__dict__ 324 325 def __ne__(self, other): 326 return not self == other 327