Class: OCI::VisualBuilder::Models::AttachmentDetails
- Inherits:
-
Object
- Object
- OCI::VisualBuilder::Models::AttachmentDetails
- Defined in:
- lib/oci/visual_builder/models/attachment_details.rb
Overview
Description of an attachments for this instance
Constant Summary collapse
- TARGET_ROLE_ENUM =
[ TARGET_ROLE_PARENT = 'PARENT'.freeze, TARGET_ROLE_CHILD = 'CHILD'.freeze, TARGET_ROLE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#is_implicit ⇒ BOOLEAN
**[Required]** * If role == `PARENT`, the attached instance was created by this service instance * If role == `CHILD`, this instance was created from attached instance on behalf of a user.
-
#target_id ⇒ String
**[Required]** The OCID of the target instance (which could be any other OCI PaaS/SaaS resource), to which this instance is attached.
-
#target_instance_url ⇒ String
**[Required]** The dataplane instance URL of the attached instance.
-
#target_role ⇒ String
**[Required]** The role of the target attachment.
-
#target_service_type ⇒ String
**[Required]** The type of the target instance, such as "FUSION".
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 = {}) ⇒ AttachmentDetails
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 = {}) ⇒ AttachmentDetails
Initializes the object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/oci/visual_builder/models/attachment_details.rb', line 79 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.target_role = attributes[:'targetRole'] if attributes[:'targetRole'] raise 'You cannot provide both :targetRole and :target_role' if attributes.key?(:'targetRole') && attributes.key?(:'target_role') self.target_role = attributes[:'target_role'] if attributes[:'target_role'] self.is_implicit = attributes[:'isImplicit'] unless attributes[:'isImplicit'].nil? raise 'You cannot provide both :isImplicit and :is_implicit' if attributes.key?(:'isImplicit') && attributes.key?(:'is_implicit') self.is_implicit = attributes[:'is_implicit'] unless attributes[:'is_implicit'].nil? self.target_id = attributes[:'targetId'] if attributes[:'targetId'] raise 'You cannot provide both :targetId and :target_id' if attributes.key?(:'targetId') && attributes.key?(:'target_id') self.target_id = attributes[:'target_id'] if attributes[:'target_id'] self.target_instance_url = attributes[:'targetInstanceUrl'] if attributes[:'targetInstanceUrl'] raise 'You cannot provide both :targetInstanceUrl and :target_instance_url' if attributes.key?(:'targetInstanceUrl') && attributes.key?(:'target_instance_url') self.target_instance_url = attributes[:'target_instance_url'] if attributes[:'target_instance_url'] self.target_service_type = attributes[:'targetServiceType'] if attributes[:'targetServiceType'] raise 'You cannot provide both :targetServiceType and :target_service_type' if attributes.key?(:'targetServiceType') && attributes.key?(:'target_service_type') self.target_service_type = attributes[:'target_service_type'] if attributes[:'target_service_type'] end |
Instance Attribute Details
#is_implicit ⇒ BOOLEAN
**[Required]** * If role == `PARENT`, the attached instance was created by this service instance
-
If role == `CHILD`, this instance was created from attached instance on behalf of a user
28 29 30 |
# File 'lib/oci/visual_builder/models/attachment_details.rb', line 28 def is_implicit @is_implicit end |
#target_id ⇒ String
**[Required]** The OCID of the target instance (which could be any other OCI PaaS/SaaS resource), to which this instance is attached.
32 33 34 |
# File 'lib/oci/visual_builder/models/attachment_details.rb', line 32 def target_id @target_id end |
#target_instance_url ⇒ String
**[Required]** The dataplane instance URL of the attached instance
36 37 38 |
# File 'lib/oci/visual_builder/models/attachment_details.rb', line 36 def target_instance_url @target_instance_url end |
#target_role ⇒ String
**[Required]** The role of the target attachment.
* `PARENT` - The target instance is the parent of this attachment.
* `CHILD` - The target instance is the child of this attachment.
22 23 24 |
# File 'lib/oci/visual_builder/models/attachment_details.rb', line 22 def target_role @target_role end |
#target_service_type ⇒ String
**[Required]** The type of the target instance, such as "FUSION".
40 41 42 |
# File 'lib/oci/visual_builder/models/attachment_details.rb', line 40 def target_service_type @target_service_type end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/oci/visual_builder/models/attachment_details.rb', line 43 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'target_role': :'targetRole', 'is_implicit': :'isImplicit', 'target_id': :'targetId', 'target_instance_url': :'targetInstanceUrl', 'target_service_type': :'targetServiceType' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/oci/visual_builder/models/attachment_details.rb', line 56 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'target_role': :'String', 'is_implicit': :'BOOLEAN', 'target_id': :'String', 'target_instance_url': :'String', 'target_service_type': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
136 137 138 139 140 141 142 143 144 145 |
# File 'lib/oci/visual_builder/models/attachment_details.rb', line 136 def ==(other) return true if equal?(other) self.class == other.class && target_role == other.target_role && is_implicit == other.is_implicit && target_id == other.target_id && target_instance_url == other.target_instance_url && target_service_type == other.target_service_type end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/oci/visual_builder/models/attachment_details.rb', line 170 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
150 151 152 |
# File 'lib/oci/visual_builder/models/attachment_details.rb', line 150 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
159 160 161 |
# File 'lib/oci/visual_builder/models/attachment_details.rb', line 159 def hash [target_role, is_implicit, target_id, target_instance_url, target_service_type].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
203 204 205 206 207 208 209 210 211 212 |
# File 'lib/oci/visual_builder/models/attachment_details.rb', line 203 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
197 198 199 |
# File 'lib/oci/visual_builder/models/attachment_details.rb', line 197 def to_s to_hash.to_s end |