Class: MistApi::AccountOauthInfo
- Defined in:
- lib/mist_api/models/account_oauth_info.rb
Overview
AccountOauthInfo Model.
Instance Attribute Summary collapse
-
#accounts ⇒ Array[AccountOauthInfoAccount]
List of linked account details.
-
#authorization_url ⇒ String
List of linked account details.
-
#linked ⇒ TrueClass | FalseClass
List of linked account details.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(accounts = nil, linked = nil, authorization_url = SKIP) ⇒ AccountOauthInfo
constructor
A new instance of AccountOauthInfo.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(accounts = nil, linked = nil, authorization_url = SKIP) ⇒ AccountOauthInfo
Returns a new instance of AccountOauthInfo.
45 46 47 48 49 |
# File 'lib/mist_api/models/account_oauth_info.rb', line 45 def initialize(accounts = nil, linked = nil, = SKIP) @accounts = accounts @authorization_url = unless == SKIP @linked = linked end |
Instance Attribute Details
#accounts ⇒ Array[AccountOauthInfoAccount]
List of linked account details
14 15 16 |
# File 'lib/mist_api/models/account_oauth_info.rb', line 14 def accounts @accounts end |
#authorization_url ⇒ String
List of linked account details
18 19 20 |
# File 'lib/mist_api/models/account_oauth_info.rb', line 18 def @authorization_url end |
#linked ⇒ TrueClass | FalseClass
List of linked account details
22 23 24 |
# File 'lib/mist_api/models/account_oauth_info.rb', line 22 def linked @linked end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/mist_api/models/account_oauth_info.rb', line 52 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it accounts = nil unless hash['accounts'].nil? accounts = [] hash['accounts'].each do |structure| accounts << (AccountOauthInfoAccount.from_hash(structure) if structure) end end accounts = nil unless hash.key?('accounts') linked = hash.key?('linked') ? hash['linked'] : nil = hash.key?('authorization_url') ? hash['authorization_url'] : SKIP # Create object from extracted values. AccountOauthInfo.new(accounts, linked, ) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/mist_api/models/account_oauth_info.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['accounts'] = 'accounts' @_hash['authorization_url'] = 'authorization_url' @_hash['linked'] = 'linked' @_hash end |
.nullables ⇒ Object
An array for nullable fields
41 42 43 |
# File 'lib/mist_api/models/account_oauth_info.rb', line 41 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 |
# File 'lib/mist_api/models/account_oauth_info.rb', line 34 def self.optionals %w[ authorization_url ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
84 85 86 87 88 |
# File 'lib/mist_api/models/account_oauth_info.rb', line 84 def inspect class_name = self.class.name.split('::').last "<#{class_name} accounts: #{@accounts.inspect}, authorization_url:"\ " #{@authorization_url.inspect}, linked: #{@linked.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
77 78 79 80 81 |
# File 'lib/mist_api/models/account_oauth_info.rb', line 77 def to_s class_name = self.class.name.split('::').last "<#{class_name} accounts: #{@accounts}, authorization_url: #{@authorization_url}, linked:"\ " #{@linked}>" end |