Class: NewStoreApi::GetClientResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/new_store_api/models/get_client_response.rb

Overview

Returns API client for the tenant.

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(description = nil, name = nil, scopes = nil, access_token_ttl = SKIP) ⇒ GetClientResponse

Returns a new instance of GetClientResponse.



50
51
52
53
54
55
56
# File 'lib/new_store_api/models/get_client_response.rb', line 50

def initialize(description = nil, name = nil, scopes = nil,
               access_token_ttl = SKIP)
  @access_token_ttl = access_token_ttl unless access_token_ttl == SKIP
  @description = description
  @name = name
  @scopes = scopes
end

Instance Attribute Details

#access_token_ttlInteger

access token validity in seconds

Returns:

  • (Integer)


14
15
16
# File 'lib/new_store_api/models/get_client_response.rb', line 14

def access_token_ttl
  @access_token_ttl
end

#descriptionString

access token validity in seconds

Returns:

  • (String)


18
19
20
# File 'lib/new_store_api/models/get_client_response.rb', line 18

def description
  @description
end

#nameString

access token validity in seconds

Returns:

  • (String)


22
23
24
# File 'lib/new_store_api/models/get_client_response.rb', line 22

def name
  @name
end

#scopesArray[String]

access token validity in seconds

Returns:

  • (Array[String])


26
27
28
# File 'lib/new_store_api/models/get_client_response.rb', line 26

def scopes
  @scopes
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/new_store_api/models/get_client_response.rb', line 59

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  description = hash.key?('description') ? hash['description'] : nil
  name = hash.key?('name') ? hash['name'] : nil
  scopes = hash.key?('scopes') ? hash['scopes'] : nil
  access_token_ttl =
    hash.key?('access_token_ttl') ? hash['access_token_ttl'] : SKIP

  # Create object from extracted values.
  GetClientResponse.new(description,
                        name,
                        scopes,
                        access_token_ttl)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/new_store_api/models/get_client_response.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['access_token_ttl'] = 'access_token_ttl'
  @_hash['description'] = 'description'
  @_hash['name'] = 'name'
  @_hash['scopes'] = 'scopes'
  @_hash
end

.nullablesObject

An array for nullable fields



46
47
48
# File 'lib/new_store_api/models/get_client_response.rb', line 46

def self.nullables
  []
end

.optionalsObject

An array for optional fields



39
40
41
42
43
# File 'lib/new_store_api/models/get_client_response.rb', line 39

def self.optionals
  %w[
    access_token_ttl
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



84
85
86
87
88
# File 'lib/new_store_api/models/get_client_response.rb', line 84

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

#to_sObject

Provides a human-readable string representation of the object.



77
78
79
80
81
# File 'lib/new_store_api/models/get_client_response.rb', line 77

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