Class: FdxV660Api::TermsAndConditionsUriEntity

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

Overview

A static public-facing URI which returns account terms and conditions via PDF files or web content rather than the JSON data elements defined in parallel

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(uri: SKIP, title: SKIP, type: SKIP, lang: 'en', effective_date: SKIP, expire_date: SKIP, additional_properties: nil) ⇒ TermsAndConditionsUriEntity

Returns a new instance of TermsAndConditionsUriEntity.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/fdx_v660_api/models/terms_and_conditions_uri_entity.rb', line 72

def initialize(uri: SKIP, title: SKIP, type: SKIP, lang: 'en',
               effective_date: SKIP, expire_date: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @uri = uri unless uri == SKIP
  @title = title unless title == SKIP
  @type = type unless type == SKIP
  @lang = lang unless lang == SKIP
  @effective_date = effective_date unless effective_date == SKIP
  @expire_date = expire_date unless expire_date == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#effective_dateDate

Date that the document or content became effective

Returns:

  • (Date)


37
38
39
# File 'lib/fdx_v660_api/models/terms_and_conditions_uri_entity.rb', line 37

def effective_date
  @effective_date
end

#expire_dateDate

Date that the document or content will expire

Returns:

  • (Date)


41
42
43
# File 'lib/fdx_v660_api/models/terms_and_conditions_uri_entity.rb', line 41

def expire_date
  @expire_date
end

#langString

The ISO 639-1 two-character language code of the content if it is not in English, as listed at ISO 639.2. Requestor indicates desired non-English language(s) in Accept-Language request header

Returns:

  • (String)


33
34
35
# File 'lib/fdx_v660_api/models/terms_and_conditions_uri_entity.rb', line 33

def lang
  @lang
end

#titleString

Name or description of the content that will be returned from the uri

Returns:

  • (String)


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

def title
  @title
end

#typeUriContentType2

What type of document or content lives at the uri, one of PDF or HTML

Returns:



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

def type
  @type
end

#uriString

Static public-facing URI which can return terms and conditions PDF files or HTML content

Returns:

  • (String)


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

def uri
  @uri
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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/fdx_v660_api/models/terms_and_conditions_uri_entity.rb', line 88

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  uri = hash.key?('uri') ? hash['uri'] : SKIP
  title = hash.key?('title') ? hash['title'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  lang = hash['lang'] ||= 'en'
  effective_date = hash.key?('effectiveDate') ? hash['effectiveDate'] : SKIP
  expire_date = hash.key?('expireDate') ? hash['expireDate'] : SKIP

  # 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.
  TermsAndConditionsUriEntity.new(uri: uri,
                                  title: title,
                                  type: type,
                                  lang: lang,
                                  effective_date: effective_date,
                                  expire_date: expire_date,
                                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



44
45
46
47
48
49
50
51
52
53
# File 'lib/fdx_v660_api/models/terms_and_conditions_uri_entity.rb', line 44

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['uri'] = 'uri'
  @_hash['title'] = 'title'
  @_hash['type'] = 'type'
  @_hash['lang'] = 'lang'
  @_hash['effective_date'] = 'effectiveDate'
  @_hash['expire_date'] = 'expireDate'
  @_hash
end

.nullablesObject

An array for nullable fields



68
69
70
# File 'lib/fdx_v660_api/models/terms_and_conditions_uri_entity.rb', line 68

def self.nullables
  []
end

.optionalsObject

An array for optional fields



56
57
58
59
60
61
62
63
64
65
# File 'lib/fdx_v660_api/models/terms_and_conditions_uri_entity.rb', line 56

def self.optionals
  %w[
    uri
    title
    type
    lang
    effective_date
    expire_date
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



118
119
120
121
122
123
124
# File 'lib/fdx_v660_api/models/terms_and_conditions_uri_entity.rb', line 118

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



135
136
137
138
139
140
# File 'lib/fdx_v660_api/models/terms_and_conditions_uri_entity.rb', line 135

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} uri: #{@uri.inspect}, title: #{@title.inspect}, type: #{@type.inspect},"\
  " lang: #{@lang.inspect}, effective_date: #{@effective_date.inspect}, expire_date:"\
  " #{@expire_date.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



127
128
129
130
131
132
# File 'lib/fdx_v660_api/models/terms_and_conditions_uri_entity.rb', line 127

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} uri: #{@uri}, title: #{@title}, type: #{@type}, lang: #{@lang},"\
  " effective_date: #{@effective_date}, expire_date: #{@expire_date}, additional_properties:"\
  " #{@additional_properties}>"
end