Class: ApiReference::MapItemRequestParams

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/api_reference/models/map_item_request_params.rb

Overview

A list of external connections to map an item to. Note that passing null will clear existing mappings. Orb requires that you pass the full list of mappings; this list will replace the existing item mappings.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(metadata: SKIP, name: SKIP, external_connections: SKIP) ⇒ MapItemRequestParams

Returns a new instance of MapItemRequestParams.



59
60
61
62
63
# File 'lib/api_reference/models/map_item_request_params.rb', line 59

def initialize(metadata: SKIP, name: SKIP, external_connections: SKIP)
  @metadata =  unless  == SKIP
  @name = name unless name == SKIP
  @external_connections = external_connections unless external_connections == SKIP
end

Instance Attribute Details

#external_connectionsArray[ItemExternalConnection]

User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.

Returns:



30
31
32
# File 'lib/api_reference/models/map_item_request_params.rb', line 30

def external_connections
  @external_connections
end

#metadataHash[String, String]

User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.

Returns:

  • (Hash[String, String])


18
19
20
# File 'lib/api_reference/models/map_item_request_params.rb', line 18

def 
  @metadata
end

#nameString

User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.

Returns:

  • (String)


24
25
26
# File 'lib/api_reference/models/map_item_request_params.rb', line 24

def name
  @name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/api_reference/models/map_item_request_params.rb', line 66

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('metadata') ? hash['metadata'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  # Parameter is an array, so we need to iterate through it
  external_connections = nil
  unless hash['external_connections'].nil?
    external_connections = []
    hash['external_connections'].each do |structure|
      external_connections << (ItemExternalConnection.from_hash(structure) if structure)
    end
  end

  external_connections = SKIP unless hash.key?('external_connections')

  # Create object from extracted values.
  MapItemRequestParams.new(metadata: ,
                           name: name,
                           external_connections: external_connections)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
# File 'lib/api_reference/models/map_item_request_params.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['metadata'] = 'metadata'
  @_hash['name'] = 'name'
  @_hash['external_connections'] = 'external_connections'
  @_hash
end

.nullablesObject

An array for nullable fields



51
52
53
54
55
56
57
# File 'lib/api_reference/models/map_item_request_params.rb', line 51

def self.nullables
  %w[
    metadata
    name
    external_connections
  ]
end

.optionalsObject

An array for optional fields



42
43
44
45
46
47
48
# File 'lib/api_reference/models/map_item_request_params.rb', line 42

def self.optionals
  %w[
    metadata
    name
    external_connections
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



97
98
99
100
101
# File 'lib/api_reference/models/map_item_request_params.rb', line 97

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} metadata: #{@metadata.inspect}, name: #{@name.inspect},"\
  " external_connections: #{@external_connections.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



90
91
92
93
94
# File 'lib/api_reference/models/map_item_request_params.rb', line 90

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} metadata: #{@metadata}, name: #{@name}, external_connections:"\
  " #{@external_connections}>"
end