Class: ApiReference::ListSubscriptionChangesQueryParams

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

Overview

ListSubscriptionChangesQueryParams 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, external_customer_id: SKIP, status: SKIP) ⇒ ListSubscriptionChangesQueryParams

Returns a new instance of ListSubscriptionChangesQueryParams.



68
69
70
71
72
73
74
75
# File 'lib/api_reference/models/list_subscription_changes_query_params.rb', line 68

def initialize(limit: 20, cursor: SKIP, customer_id: SKIP,
               external_customer_id: SKIP, status: SKIP)
  @limit = limit unless limit == SKIP
  @cursor = cursor unless cursor == SKIP
  @customer_id = customer_id unless customer_id == SKIP
  @external_customer_id = external_customer_id unless external_customer_id == SKIP
  @status = status unless status == SKIP
end

Instance Attribute Details

#cursorString

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

Returns:

  • (String)


19
20
21
# File 'lib/api_reference/models/list_subscription_changes_query_params.rb', line 19

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)


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

def customer_id
  @customer_id
end

#external_customer_idString

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

Returns:

  • (String)


29
30
31
# File 'lib/api_reference/models/list_subscription_changes_query_params.rb', line 29

def external_customer_id
  @external_customer_id
end

#limitInteger

The number of items to fetch. Defaults to 20.

Returns:

  • (Integer)


14
15
16
# File 'lib/api_reference/models/list_subscription_changes_query_params.rb', line 14

def limit
  @limit
end

#statusStatus12

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

Returns:



34
35
36
# File 'lib/api_reference/models/list_subscription_changes_query_params.rb', line 34

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/api_reference/models/list_subscription_changes_query_params.rb', line 78

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
  external_customer_id =
    hash.key?('external_customer_id') ? hash['external_customer_id'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP

  # Create object from extracted values.
  ListSubscriptionChangesQueryParams.new(limit: limit,
                                         cursor: cursor,
                                         customer_id: customer_id,
                                         external_customer_id: external_customer_id,
                                         status: status)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
45
# File 'lib/api_reference/models/list_subscription_changes_query_params.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['limit'] = 'limit'
  @_hash['cursor'] = 'cursor'
  @_hash['customer_id'] = 'customer_id'
  @_hash['external_customer_id'] = 'external_customer_id'
  @_hash['status'] = 'status'
  @_hash
end

.nullablesObject

An array for nullable fields



59
60
61
62
63
64
65
66
# File 'lib/api_reference/models/list_subscription_changes_query_params.rb', line 59

def self.nullables
  %w[
    cursor
    customer_id
    external_customer_id
    status
  ]
end

.optionalsObject

An array for optional fields



48
49
50
51
52
53
54
55
56
# File 'lib/api_reference/models/list_subscription_changes_query_params.rb', line 48

def self.optionals
  %w[
    limit
    cursor
    customer_id
    external_customer_id
    status
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



105
106
107
108
109
110
# File 'lib/api_reference/models/list_subscription_changes_query_params.rb', line 105

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} limit: #{@limit.inspect}, cursor: #{@cursor.inspect}, customer_id:"\
  " #{@customer_id.inspect}, external_customer_id: #{@external_customer_id.inspect}, status:"\
  " #{@status.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



98
99
100
101
102
# File 'lib/api_reference/models/list_subscription_changes_query_params.rb', line 98

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} limit: #{@limit}, cursor: #{@cursor}, customer_id: #{@customer_id},"\
  " external_customer_id: #{@external_customer_id}, status: #{@status}>"
end