Class: OCI::OsManagementHub::Models::SoftwareSourceAvailability
- Inherits:
-
Object
- Object
- OCI::OsManagementHub::Models::SoftwareSourceAvailability
- Defined in:
- lib/oci/os_management_hub/models/software_source_availability.rb
Overview
An object that defines the OCID and the availability of a vendor software source.
Constant Summary collapse
- AVAILABILITY_ENUM =
[ AVAILABILITY_AVAILABLE = 'AVAILABLE'.freeze, AVAILABILITY_SELECTED = 'SELECTED'.freeze, AVAILABILITY_RESTRICTED = 'RESTRICTED'.freeze, AVAILABILITY_UNAVAILABLE = 'UNAVAILABLE'.freeze ].freeze
- AVAILABILITY_AT_OCI_ENUM =
[ AVAILABILITY_AT_OCI_AVAILABLE = 'AVAILABLE'.freeze, AVAILABILITY_AT_OCI_SELECTED = 'SELECTED'.freeze, AVAILABILITY_AT_OCI_RESTRICTED = 'RESTRICTED'.freeze, AVAILABILITY_AT_OCI_UNAVAILABLE = 'UNAVAILABLE'.freeze ].freeze
Instance Attribute Summary collapse
-
#availability ⇒ String
Availability of the software source to instances in private data centers or third-party clouds.
-
#availability_at_oci ⇒ String
Availability of the software source to OCI instances.
-
#software_source_id ⇒ String
[Required] The OCID of the vendor software source.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ SoftwareSourceAvailability
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ SoftwareSourceAvailability
Initializes the object
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/oci/os_management_hub/models/software_source_availability.rb', line 68 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.software_source_id = attributes[:'softwareSourceId'] if attributes[:'softwareSourceId'] raise 'You cannot provide both :softwareSourceId and :software_source_id' if attributes.key?(:'softwareSourceId') && attributes.key?(:'software_source_id') self.software_source_id = attributes[:'software_source_id'] if attributes[:'software_source_id'] self.availability = attributes[:'availability'] if attributes[:'availability'] self.availability_at_oci = attributes[:'availabilityAtOci'] if attributes[:'availabilityAtOci'] raise 'You cannot provide both :availabilityAtOci and :availability_at_oci' if attributes.key?(:'availabilityAtOci') && attributes.key?(:'availability_at_oci') self.availability_at_oci = attributes[:'availability_at_oci'] if attributes[:'availability_at_oci'] end |
Instance Attribute Details
#availability ⇒ String
Availability of the software source to instances in private data centers or third-party clouds.
31 32 33 |
# File 'lib/oci/os_management_hub/models/software_source_availability.rb', line 31 def availability @availability end |
#availability_at_oci ⇒ String
Availability of the software source to OCI instances.
35 36 37 |
# File 'lib/oci/os_management_hub/models/software_source_availability.rb', line 35 def availability_at_oci @availability_at_oci end |
#software_source_id ⇒ String
[Required] The OCID of the vendor software source.
27 28 29 |
# File 'lib/oci/os_management_hub/models/software_source_availability.rb', line 27 def software_source_id @software_source_id end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
38 39 40 41 42 43 44 45 46 |
# File 'lib/oci/os_management_hub/models/software_source_availability.rb', line 38 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'software_source_id': :'softwareSourceId', 'availability': :'availability', 'availability_at_oci': :'availabilityAtOci' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
49 50 51 52 53 54 55 56 57 |
# File 'lib/oci/os_management_hub/models/software_source_availability.rb', line 49 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'software_source_id': :'String', 'availability': :'String', 'availability_at_oci': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
112 113 114 115 116 117 118 119 |
# File 'lib/oci/os_management_hub/models/software_source_availability.rb', line 112 def ==(other) return true if equal?(other) self.class == other.class && software_source_id == other.software_source_id && availability == other.availability && availability_at_oci == other.availability_at_oci end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/oci/os_management_hub/models/software_source_availability.rb', line 144 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
124 125 126 |
# File 'lib/oci/os_management_hub/models/software_source_availability.rb', line 124 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
133 134 135 |
# File 'lib/oci/os_management_hub/models/software_source_availability.rb', line 133 def hash [software_source_id, availability, availability_at_oci].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
177 178 179 180 181 182 183 184 185 186 |
# File 'lib/oci/os_management_hub/models/software_source_availability.rb', line 177 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
171 172 173 |
# File 'lib/oci/os_management_hub/models/software_source_availability.rb', line 171 def to_s to_hash.to_s end |