Class: FdxV660Api::Intermediary

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/fdx_v660_api/models/intermediary.rb

Overview

Data Access Platform, Service Provider, or any other entity in the data sharing chain between a Data Provider to a Data Recipient. Properties in this structure use 'snake_case' names to match the properties in IETF RFC 7591

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(name: SKIP, description: SKIP, uri: SKIP, logo_uri: SKIP, contacts: SKIP, registry_references: SKIP, additional_properties: nil) ⇒ Intermediary

Returns a new instance of Intermediary.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/fdx_v660_api/models/intermediary.rb', line 69

def initialize(name: SKIP, description: SKIP, uri: SKIP, logo_uri: SKIP,
               contacts: SKIP, registry_references: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @name = name unless name == SKIP
  @description = description unless description == SKIP
  @uri = uri unless uri == SKIP
  @logo_uri = logo_uri unless logo_uri == SKIP
  @contacts = contacts unless contacts == SKIP
  @registry_references = registry_references unless registry_references == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#contactsArray[String]

Array of strings representing ways to contact people responsible for this intermediary

Returns:

  • (Array[String])


34
35
36
# File 'lib/fdx_v660_api/models/intermediary.rb', line 34

def contacts
  @contacts
end

#descriptionString

A short description of the intermediary

Returns:

  • (String)


21
22
23
# File 'lib/fdx_v660_api/models/intermediary.rb', line 21

def description
  @description
end

#logo_uriString

A URL string that references a logo for this intermediary

Returns:

  • (String)


29
30
31
# File 'lib/fdx_v660_api/models/intermediary.rb', line 29

def logo_uri
  @logo_uri
end

#nameString

Name of intermediary party

Returns:

  • (String)


17
18
19
# File 'lib/fdx_v660_api/models/intermediary.rb', line 17

def name
  @name
end

#registry_referencesArray[RegistryReference]

Registry references for this intermediary

Returns:



38
39
40
# File 'lib/fdx_v660_api/models/intermediary.rb', line 38

def registry_references
  @registry_references
end

#uriString

A URL string of a web page providing information about the intermediary

Returns:

  • (String)


25
26
27
# File 'lib/fdx_v660_api/models/intermediary.rb', line 25

def uri
  @uri
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
115
116
117
118
119
120
# File 'lib/fdx_v660_api/models/intermediary.rb', line 85

def self.from_hash(hash)
  return nil unless hash

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

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

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  Intermediary.new(name: name,
                   description: description,
                   uri: uri,
                   logo_uri: logo_uri,
                   contacts: contacts,
                   registry_references: registry_references,
                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



41
42
43
44
45
46
47
48
49
50
# File 'lib/fdx_v660_api/models/intermediary.rb', line 41

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name'] = 'name'
  @_hash['description'] = 'description'
  @_hash['uri'] = 'uri'
  @_hash['logo_uri'] = 'logo_uri'
  @_hash['contacts'] = 'contacts'
  @_hash['registry_references'] = 'registry_references'
  @_hash
end

.nullablesObject

An array for nullable fields



65
66
67
# File 'lib/fdx_v660_api/models/intermediary.rb', line 65

def self.nullables
  []
end

.optionalsObject

An array for optional fields



53
54
55
56
57
58
59
60
61
62
# File 'lib/fdx_v660_api/models/intermediary.rb', line 53

def self.optionals
  %w[
    name
    description
    uri
    logo_uri
    contacts
    registry_references
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



131
132
133
134
135
136
137
# File 'lib/fdx_v660_api/models/intermediary.rb', line 131

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name.inspect}, description: #{@description.inspect}, uri:"\
  " #{@uri.inspect}, logo_uri: #{@logo_uri.inspect}, contacts: #{@contacts.inspect},"\
  " registry_references: #{@registry_references.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



123
124
125
126
127
128
# File 'lib/fdx_v660_api/models/intermediary.rb', line 123

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name}, description: #{@description}, uri: #{@uri}, logo_uri:"\
  " #{@logo_uri}, contacts: #{@contacts}, registry_references: #{@registry_references},"\
  " additional_properties: #{@additional_properties}>"
end