Class: ApiReference::ListSubscriptionsQueryParams

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

Overview

ListSubscriptionsQueryParams 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(limit: 20, cursor: SKIP, customer_id: SKIP, customer_id_1: SKIP, external_customer_id: SKIP, external_customer_id_1: SKIP, plan_id: SKIP, external_plan_id: SKIP, status: SKIP, status_1: SKIP, created_at_gte: SKIP, created_at_gt: SKIP, created_at_lt: SKIP, created_at_lte: SKIP) ⇒ ListSubscriptionsQueryParams

Returns a new instance of ListSubscriptionsQueryParams.



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 141

def initialize(limit: 20, cursor: SKIP, customer_id: SKIP,
               customer_id_1: SKIP, external_customer_id: SKIP,
               external_customer_id_1: SKIP, plan_id: SKIP,
               external_plan_id: SKIP, status: SKIP, status_1: SKIP,
               created_at_gte: SKIP, created_at_gt: SKIP,
               created_at_lt: SKIP, created_at_lte: SKIP)
  @limit = limit unless limit == SKIP
  @cursor = cursor unless cursor == SKIP
  @customer_id = customer_id unless customer_id == SKIP
  @customer_id_1 = customer_id_1 unless customer_id_1 == SKIP
  @external_customer_id = external_customer_id unless external_customer_id == SKIP
  @external_customer_id_1 = external_customer_id_1 unless external_customer_id_1 == SKIP
  @plan_id = plan_id unless plan_id == SKIP
  @external_plan_id = external_plan_id unless external_plan_id == SKIP
  @status = status unless status == SKIP
  @status_1 = status_1 unless status_1 == SKIP
  @created_at_gte = created_at_gte unless created_at_gte == SKIP
  @created_at_gt = created_at_gt unless created_at_gt == SKIP
  @created_at_lt = created_at_lt unless created_at_lt == SKIP
  @created_at_lte = created_at_lte unless created_at_lte == SKIP
end

Instance Attribute Details

#created_at_gtDateTime

Cursor for pagination. This can be populated by the next_cursor value returned from the initial request.

Returns:

  • (DateTime)


70
71
72
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 70

def created_at_gt
  @created_at_gt
end

#created_at_gteDateTime

Cursor for pagination. This can be populated by the next_cursor value returned from the initial request.

Returns:

  • (DateTime)


65
66
67
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 65

def created_at_gte
  @created_at_gte
end

#created_at_ltDateTime

Cursor for pagination. This can be populated by the next_cursor value returned from the initial request.

Returns:

  • (DateTime)


75
76
77
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 75

def created_at_lt
  @created_at_lt
end

#created_at_lteDateTime

Cursor for pagination. This can be populated by the next_cursor value returned from the initial request.

Returns:

  • (DateTime)


80
81
82
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 80

def created_at_lte
  @created_at_lte
end

#cursorString

Cursor for pagination. This can be populated by the next_cursor value returned from the initial request.

Returns:

  • (String)


20
21
22
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 20

def cursor
  @cursor
end

#customer_idString

Cursor for pagination. This can be populated by the next_cursor value returned from the initial request.

Returns:

  • (String)


25
26
27
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 25

def customer_id
  @customer_id
end

#customer_id_1Array[String]

Cursor for pagination. This can be populated by the next_cursor value returned from the initial request.

Returns:

  • (Array[String])


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

def customer_id_1
  @customer_id_1
end

#external_customer_idString

Cursor for pagination. This can be populated by the next_cursor value returned from the initial request.

Returns:

  • (String)


35
36
37
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 35

def external_customer_id
  @external_customer_id
end

#external_customer_id_1Array[String]

Cursor for pagination. This can be populated by the next_cursor value returned from the initial request.

Returns:

  • (Array[String])


40
41
42
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 40

def external_customer_id_1
  @external_customer_id_1
end

#external_plan_idString

Cursor for pagination. This can be populated by the next_cursor value returned from the initial request.

Returns:

  • (String)


50
51
52
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 50

def external_plan_id
  @external_plan_id
end

#limitInteger

The number of items to fetch. Defaults to 20.

Returns:

  • (Integer)


15
16
17
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 15

def limit
  @limit
end

#plan_idString

Cursor for pagination. This can be populated by the next_cursor value returned from the initial request.

Returns:

  • (String)


45
46
47
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 45

def plan_id
  @plan_id
end

#statusStatus13

Cursor for pagination. This can be populated by the next_cursor value returned from the initial request.

Returns:



55
56
57
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 55

def status
  @status
end

#status_1Array[Status14]

Cursor for pagination. This can be populated by the next_cursor value returned from the initial request.

Returns:



60
61
62
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 60

def status_1
  @status_1
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 164

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  limit = hash['limit'] ||= 20
  cursor = hash.key?('cursor') ? hash['cursor'] : SKIP
  customer_id = hash.key?('customer_id') ? hash['customer_id'] : SKIP
  customer_id_1 = hash.key?('customer_id_1') ? hash['customer_id_1'] : SKIP
  external_customer_id =
    hash.key?('external_customer_id') ? hash['external_customer_id'] : SKIP
  external_customer_id_1 =
    hash.key?('external_customer_id_1') ? hash['external_customer_id_1'] : SKIP
  plan_id = hash.key?('plan_id') ? hash['plan_id'] : SKIP
  external_plan_id =
    hash.key?('external_plan_id') ? hash['external_plan_id'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  status_1 = hash.key?('status_1') ? hash['status_1'] : SKIP
  created_at_gte = if hash.key?('created_at[gte]')
                     (DateTimeHelper.from_rfc3339(hash['created_at[gte]']) if hash['created_at[gte]'])
                   else
                     SKIP
                   end
  created_at_gt = if hash.key?('created_at[gt]')
                    (DateTimeHelper.from_rfc3339(hash['created_at[gt]']) if hash['created_at[gt]'])
                  else
                    SKIP
                  end
  created_at_lt = if hash.key?('created_at[lt]')
                    (DateTimeHelper.from_rfc3339(hash['created_at[lt]']) if hash['created_at[lt]'])
                  else
                    SKIP
                  end
  created_at_lte = if hash.key?('created_at[lte]')
                     (DateTimeHelper.from_rfc3339(hash['created_at[lte]']) if hash['created_at[lte]'])
                   else
                     SKIP
                   end

  # Create object from extracted values.
  ListSubscriptionsQueryParams.new(limit: limit,
                                   cursor: cursor,
                                   customer_id: customer_id,
                                   customer_id_1: customer_id_1,
                                   external_customer_id: external_customer_id,
                                   external_customer_id_1: external_customer_id_1,
                                   plan_id: plan_id,
                                   external_plan_id: external_plan_id,
                                   status: status,
                                   status_1: status_1,
                                   created_at_gte: created_at_gte,
                                   created_at_gt: created_at_gt,
                                   created_at_lt: created_at_lt,
                                   created_at_lte: created_at_lte)
end

.namesObject

A mapping from model property names to API property names.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 83

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['limit'] = 'limit'
  @_hash['cursor'] = 'cursor'
  @_hash['customer_id'] = 'customer_id'
  @_hash['customer_id_1'] = 'customer_id_1'
  @_hash['external_customer_id'] = 'external_customer_id'
  @_hash['external_customer_id_1'] = 'external_customer_id_1'
  @_hash['plan_id'] = 'plan_id'
  @_hash['external_plan_id'] = 'external_plan_id'
  @_hash['status'] = 'status'
  @_hash['status_1'] = 'status_1'
  @_hash['created_at_gte'] = 'created_at[gte]'
  @_hash['created_at_gt'] = 'created_at[gt]'
  @_hash['created_at_lt'] = 'created_at[lt]'
  @_hash['created_at_lte'] = 'created_at[lte]'
  @_hash
end

.nullablesObject

An array for nullable fields



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 123

def self.nullables
  %w[
    cursor
    customer_id
    customer_id_1
    external_customer_id
    external_customer_id_1
    plan_id
    external_plan_id
    status
    status_1
    created_at_gte
    created_at_gt
    created_at_lt
    created_at_lte
  ]
end

.optionalsObject

An array for optional fields



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 103

def self.optionals
  %w[
    limit
    cursor
    customer_id
    customer_id_1
    external_customer_id
    external_customer_id_1
    plan_id
    external_plan_id
    status
    status_1
    created_at_gte
    created_at_gt
    created_at_lt
    created_at_lte
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



247
248
249
250
251
252
253
254
255
256
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 247

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} limit: #{@limit.inspect}, cursor: #{@cursor.inspect}, customer_id:"\
  " #{@customer_id.inspect}, customer_id_1: #{@customer_id_1.inspect}, external_customer_id:"\
  " #{@external_customer_id.inspect}, external_customer_id_1:"\
  " #{@external_customer_id_1.inspect}, plan_id: #{@plan_id.inspect}, external_plan_id:"\
  " #{@external_plan_id.inspect}, status: #{@status.inspect}, status_1: #{@status_1.inspect},"\
  " created_at_gte: #{@created_at_gte.inspect}, created_at_gt: #{@created_at_gt.inspect},"\
  " created_at_lt: #{@created_at_lt.inspect}, created_at_lte: #{@created_at_lte.inspect}>"
end

#to_custom_created_at_gtObject



223
224
225
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 223

def to_custom_created_at_gt
  DateTimeHelper.to_rfc3339(created_at_gt)
end

#to_custom_created_at_gteObject



219
220
221
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 219

def to_custom_created_at_gte
  DateTimeHelper.to_rfc3339(created_at_gte)
end

#to_custom_created_at_ltObject



227
228
229
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 227

def to_custom_created_at_lt
  DateTimeHelper.to_rfc3339(created_at_lt)
end

#to_custom_created_at_lteObject



231
232
233
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 231

def to_custom_created_at_lte
  DateTimeHelper.to_rfc3339(created_at_lte)
end

#to_sObject

Provides a human-readable string representation of the object.



236
237
238
239
240
241
242
243
244
# File 'lib/api_reference/models/list_subscriptions_query_params.rb', line 236

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} limit: #{@limit}, cursor: #{@cursor}, customer_id: #{@customer_id},"\
  " customer_id_1: #{@customer_id_1}, external_customer_id: #{@external_customer_id},"\
  " external_customer_id_1: #{@external_customer_id_1}, plan_id: #{@plan_id},"\
  " external_plan_id: #{@external_plan_id}, status: #{@status}, status_1: #{@status_1},"\
  " created_at_gte: #{@created_at_gte}, created_at_gt: #{@created_at_gt}, created_at_lt:"\
  " #{@created_at_lt}, created_at_lte: #{@created_at_lte}>"
end