Class: ApiReference::FetchLicenseByExternalId

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

Overview

FetchLicenseByExternalId 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:, license_type_id:) ⇒ FetchLicenseByExternalId

Returns a new instance of FetchLicenseByExternalId.



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

def initialize(subscription_id:, license_type_id:)
  @subscription_id = subscription_id
  @license_type_id = license_type_id
end

Instance Attribute Details

#license_type_idString

The ID of the license type to fetch the license for.

Returns:

  • (String)


18
19
20
# File 'lib/api_reference/models/fetch_license_by_external_id.rb', line 18

def license_type_id
  @license_type_id
end

#subscription_idString

The ID of the subscription to fetch the license for.

Returns:

  • (String)


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

def subscription_id
  @subscription_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/api_reference/models/fetch_license_by_external_id.rb', line 44

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  subscription_id =
    hash.key?('subscription_id') ? hash['subscription_id'] : nil
  license_type_id =
    hash.key?('license_type_id') ? hash['license_type_id'] : nil

  # Create object from extracted values.
  FetchLicenseByExternalId.new(subscription_id: subscription_id,
                               license_type_id: license_type_id)
end

.namesObject

A mapping from model property names to API property names.



21
22
23
24
25
26
# File 'lib/api_reference/models/fetch_license_by_external_id.rb', line 21

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

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



66
67
68
69
70
# File 'lib/api_reference/models/fetch_license_by_external_id.rb', line 66

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

#to_sObject

Provides a human-readable string representation of the object.



59
60
61
62
63
# File 'lib/api_reference/models/fetch_license_by_external_id.rb', line 59

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