Class: StickyIoRestfulApiV2025731::GetProductCustomFields

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb

Overview

GetProductCustomFields Model.

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(status:, current_page:, data:, first_page_url:, from:, last_page:, last_page_url:, next_page_url:, path:, per_page:, prev_page_url:, to:, total:, additional_properties: nil) ⇒ GetProductCustomFields

Returns a new instance of GetProductCustomFields.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 96

def initialize(status:, current_page:, data:, first_page_url:, from:,
               last_page:, last_page_url:, next_page_url:, path:, per_page:,
               prev_page_url:, to:, total:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @status = status
  @current_page = current_page
  @data = data
  @first_page_url = first_page_url
  @from = from
  @last_page = last_page
  @last_page_url = last_page_url
  @next_page_url = next_page_url
  @path = path
  @per_page = per_page
  @prev_page_url = prev_page_url
  @to = to
  @total = total
  @additional_properties = additional_properties
end

Instance Attribute Details

#current_pageInteger

TODO: Write general description for this method

Returns:

  • (Integer)


18
19
20
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 18

def current_page
  @current_page
end

#dataArray[DataGetProductCustomFields]

TODO: Write general description for this method

Returns:



22
23
24
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 22

def data
  @data
end

#first_page_urlString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 26

def first_page_url
  @first_page_url
end

#fromInteger

TODO: Write general description for this method

Returns:

  • (Integer)


30
31
32
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 30

def from
  @from
end

#last_pageInteger

TODO: Write general description for this method

Returns:

  • (Integer)


34
35
36
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 34

def last_page
  @last_page
end

#last_page_urlString

TODO: Write general description for this method

Returns:

  • (String)


38
39
40
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 38

def last_page_url
  @last_page_url
end

#next_page_urlString

TODO: Write general description for this method

Returns:

  • (String)


42
43
44
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 42

def next_page_url
  @next_page_url
end

#pathString

TODO: Write general description for this method

Returns:

  • (String)


46
47
48
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 46

def path
  @path
end

#per_pageInteger

TODO: Write general description for this method

Returns:

  • (Integer)


50
51
52
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 50

def per_page
  @per_page
end

#prev_page_urlString

TODO: Write general description for this method

Returns:

  • (String)


54
55
56
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 54

def prev_page_url
  @prev_page_url
end

#statusString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 14

def status
  @status
end

#toInteger

TODO: Write general description for this method

Returns:

  • (Integer)


58
59
60
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 58

def to
  @to
end

#totalInteger

TODO: Write general description for this method

Returns:

  • (Integer)


62
63
64
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 62

def total
  @total
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 119

def self.from_hash(hash)
  return nil unless hash

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

  data = nil unless hash.key?('data')
  first_page_url =
    hash.key?('first_page_url') ? hash['first_page_url'] : nil
  from = hash.key?('from') ? hash['from'] : nil
  last_page = hash.key?('last_page') ? hash['last_page'] : nil
  last_page_url = hash.key?('last_page_url') ? hash['last_page_url'] : nil
  next_page_url = hash.key?('next_page_url') ? hash['next_page_url'] : nil
  path = hash.key?('path') ? hash['path'] : nil
  per_page = hash.key?('per_page') ? hash['per_page'] : nil
  prev_page_url = hash.key?('prev_page_url') ? hash['prev_page_url'] : nil
  to = hash.key?('to') ? hash['to'] : nil
  total = hash.key?('total') ? hash['total'] : nil

  # 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.
  GetProductCustomFields.new(status: status,
                             current_page: current_page,
                             data: data,
                             first_page_url: first_page_url,
                             from: from,
                             last_page: last_page,
                             last_page_url: last_page_url,
                             next_page_url: next_page_url,
                             path: path,
                             per_page: per_page,
                             prev_page_url: prev_page_url,
                             to: to,
                             total: total,
                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 65

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['status'] = 'status'
  @_hash['current_page'] = 'current_page'
  @_hash['data'] = 'data'
  @_hash['first_page_url'] = 'first_page_url'
  @_hash['from'] = 'from'
  @_hash['last_page'] = 'last_page'
  @_hash['last_page_url'] = 'last_page_url'
  @_hash['next_page_url'] = 'next_page_url'
  @_hash['path'] = 'path'
  @_hash['per_page'] = 'per_page'
  @_hash['prev_page_url'] = 'prev_page_url'
  @_hash['to'] = 'to'
  @_hash['total'] = 'total'
  @_hash
end

.nullablesObject

An array for nullable fields



89
90
91
92
93
94
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 89

def self.nullables
  %w[
    next_page_url
    prev_page_url
  ]
end

.optionalsObject

An array for optional fields



84
85
86
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 84

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



182
183
184
185
186
187
188
189
190
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 182

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} status: #{@status.inspect}, current_page: #{@current_page.inspect}, data:"\
  " #{@data.inspect}, first_page_url: #{@first_page_url.inspect}, from: #{@from.inspect},"\
  " last_page: #{@last_page.inspect}, last_page_url: #{@last_page_url.inspect}, next_page_url:"\
  " #{@next_page_url.inspect}, path: #{@path.inspect}, per_page: #{@per_page.inspect},"\
  " prev_page_url: #{@prev_page_url.inspect}, to: #{@to.inspect}, total: #{@total.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



172
173
174
175
176
177
178
179
# File 'lib/sticky_io_restful_api_v2025731/models/get_product_custom_fields.rb', line 172

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} status: #{@status}, current_page: #{@current_page}, data: #{@data},"\
  " first_page_url: #{@first_page_url}, from: #{@from}, last_page: #{@last_page},"\
  " last_page_url: #{@last_page_url}, next_page_url: #{@next_page_url}, path: #{@path},"\
  " per_page: #{@per_page}, prev_page_url: #{@prev_page_url}, to: #{@to}, total: #{@total},"\
  " additional_properties: #{@additional_properties}>"
end