Class: ApiReference::ListLicensesParams

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

Overview

ListLicensesParams 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(subscription_id:, limit: 20, cursor: SKIP, license_type_id: SKIP, external_license_id: SKIP, status: SKIP) ⇒ ListLicensesParams

Returns a new instance of ListLicensesParams.



74
75
76
77
78
79
80
81
82
83
# File 'lib/api_reference/models/list_licenses_params.rb', line 74

def initialize(subscription_id:, limit: 20, cursor: SKIP,
               license_type_id: SKIP, external_license_id: SKIP,
               status: SKIP)
  @limit = limit unless limit == SKIP
  @cursor = cursor unless cursor == SKIP
  @subscription_id = subscription_id
  @license_type_id = license_type_id unless license_type_id == SKIP
  @external_license_id = external_license_id unless external_license_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_licenses_params.rb', line 19

def cursor
  @cursor
end

#external_license_idString

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

Returns:

  • (String)


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

def external_license_id
  @external_license_id
end

#license_type_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_licenses_params.rb', line 29

def license_type_id
  @license_type_id
end

#limitInteger

The number of items to fetch. Defaults to 20.

Returns:

  • (Integer)


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

def limit
  @limit
end

#statusStatus7

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

Returns:



39
40
41
# File 'lib/api_reference/models/list_licenses_params.rb', line 39

def status
  @status
end

#subscription_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_licenses_params.rb', line 24

def subscription_id
  @subscription_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/api_reference/models/list_licenses_params.rb', line 86

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  subscription_id =
    hash.key?('subscription_id') ? hash['subscription_id'] : nil
  limit = hash['limit'] ||= 20
  cursor = hash.key?('cursor') ? hash['cursor'] : SKIP
  license_type_id =
    hash.key?('license_type_id') ? hash['license_type_id'] : SKIP
  external_license_id =
    hash.key?('external_license_id') ? hash['external_license_id'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP

  # Create object from extracted values.
  ListLicensesParams.new(subscription_id: subscription_id,
                         limit: limit,
                         cursor: cursor,
                         license_type_id: license_type_id,
                         external_license_id: external_license_id,
                         status: status)
end

.namesObject

A mapping from model property names to API property names.



42
43
44
45
46
47
48
49
50
51
# File 'lib/api_reference/models/list_licenses_params.rb', line 42

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['limit'] = 'limit'
  @_hash['cursor'] = 'cursor'
  @_hash['subscription_id'] = 'subscription_id'
  @_hash['license_type_id'] = 'license_type_id'
  @_hash['external_license_id'] = 'external_license_id'
  @_hash['status'] = 'status'
  @_hash
end

.nullablesObject

An array for nullable fields



65
66
67
68
69
70
71
72
# File 'lib/api_reference/models/list_licenses_params.rb', line 65

def self.nullables
  %w[
    cursor
    license_type_id
    external_license_id
    status
  ]
end

.optionalsObject

An array for optional fields



54
55
56
57
58
59
60
61
62
# File 'lib/api_reference/models/list_licenses_params.rb', line 54

def self.optionals
  %w[
    limit
    cursor
    license_type_id
    external_license_id
    status
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



118
119
120
121
122
123
# File 'lib/api_reference/models/list_licenses_params.rb', line 118

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

#to_sObject

Provides a human-readable string representation of the object.



110
111
112
113
114
115
# File 'lib/api_reference/models/list_licenses_params.rb', line 110

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