Class: Gusto::Token::TokenGetInfoResponse
- Inherits:
-
Object
- Object
- Gusto::Token::TokenGetInfoResponse
- Defined in:
- lib/fern_gusto/token/types/token_get_info_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#resource ⇒ Gusto::Token::TokenGetInfoResponseResource
readonly
Information about the token resource.
-
#resource_owner ⇒ Gusto::Token::TokenGetInfoResponseResourceOwner
readonly
Information about the token owner.
-
#scope ⇒ String
readonly
Space delimited string of accessible scopes.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(scope:, resource:, resource_owner: OMIT, additional_properties: nil) ⇒ Gusto::Token::TokenGetInfoResponse constructor
- #to_json ⇒ String
Constructor Details
#initialize(scope:, resource:, resource_owner: OMIT, additional_properties: nil) ⇒ Gusto::Token::TokenGetInfoResponse
30 31 32 33 34 35 36 37 38 |
# File 'lib/fern_gusto/token/types/token_get_info_response.rb', line 30 def initialize(scope:, resource:, resource_owner: OMIT, additional_properties: nil) @scope = scope @resource = resource @resource_owner = resource_owner if resource_owner != OMIT @additional_properties = additional_properties @_field_set = { "scope": scope, "resource": resource, "resource_owner": resource_owner }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
18 19 20 |
# File 'lib/fern_gusto/token/types/token_get_info_response.rb', line 18 def additional_properties @additional_properties end |
#resource ⇒ Gusto::Token::TokenGetInfoResponseResource (readonly)
Returns Information about the token resource.
14 15 16 |
# File 'lib/fern_gusto/token/types/token_get_info_response.rb', line 14 def resource @resource end |
#resource_owner ⇒ Gusto::Token::TokenGetInfoResponseResourceOwner (readonly)
Returns Information about the token owner.
16 17 18 |
# File 'lib/fern_gusto/token/types/token_get_info_response.rb', line 16 def resource_owner @resource_owner end |
#scope ⇒ String (readonly)
Returns Space delimited string of accessible scopes.
12 13 14 |
# File 'lib/fern_gusto/token/types/token_get_info_response.rb', line 12 def scope @scope end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::Token::TokenGetInfoResponse
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/fern_gusto/token/types/token_get_info_response.rb', line 43 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) scope = parsed_json["scope"] unless parsed_json["resource"].nil? resource = parsed_json["resource"].to_json resource = Gusto::Token::TokenGetInfoResponseResource.from_json(json_object: resource) else resource = nil end unless parsed_json["resource_owner"].nil? resource_owner = parsed_json["resource_owner"].to_json resource_owner = Gusto::Token::TokenGetInfoResponseResourceOwner.from_json(json_object: resource_owner) else resource_owner = nil end new( scope: scope, resource: resource, resource_owner: resource_owner, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
78 79 80 81 82 |
# File 'lib/fern_gusto/token/types/token_get_info_response.rb', line 78 def self.validate_raw(obj:) obj.scope.is_a?(String) != false || raise("Passed value for field obj.scope is not the expected type, validation failed.") Gusto::Token::TokenGetInfoResponseResource.validate_raw(obj: obj.resource) obj.resource_owner.nil? || Gusto::Token::TokenGetInfoResponseResourceOwner.validate_raw(obj: obj.resource_owner) end |
Instance Method Details
#to_json ⇒ String
69 70 71 |
# File 'lib/fern_gusto/token/types/token_get_info_response.rb', line 69 def to_json @_field_set&.to_json end |