Class: Merge::Filestorage::MetaResponse
- Inherits:
-
Object
- Object
- Merge::Filestorage::MetaResponse
- Defined in:
- lib/merge_ruby_client/filestorage/types/meta_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #has_conditional_params ⇒ Boolean readonly
- #has_required_linked_account_params ⇒ Boolean readonly
- #remote_field_classes ⇒ Hash{String => Object} readonly
- #request_schema ⇒ Hash{String => Object} readonly
- #status ⇒ Merge::Filestorage::LinkedAccountStatus readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Filestorage::MetaResponse
Deserialize a JSON object to an instance of MetaResponse.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(request_schema:, has_conditional_params:, has_required_linked_account_params:, remote_field_classes: OMIT, status: OMIT, additional_properties: nil) ⇒ Merge::Filestorage::MetaResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of MetaResponse to a JSON object.
Constructor Details
#initialize(request_schema:, has_conditional_params:, has_required_linked_account_params:, remote_field_classes: OMIT, status: OMIT, additional_properties: nil) ⇒ Merge::Filestorage::MetaResponse
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/merge_ruby_client/filestorage/types/meta_response.rb', line 35 def initialize(request_schema:, has_conditional_params:, has_required_linked_account_params:, remote_field_classes: OMIT, status: OMIT, additional_properties: nil) @request_schema = request_schema @remote_field_classes = remote_field_classes if remote_field_classes != OMIT @status = status if status != OMIT @has_conditional_params = has_conditional_params @has_required_linked_account_params = has_required_linked_account_params @additional_properties = additional_properties @_field_set = { "request_schema": request_schema, "remote_field_classes": remote_field_classes, "status": status, "has_conditional_params": has_conditional_params, "has_required_linked_account_params": has_required_linked_account_params }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
21 22 23 |
# File 'lib/merge_ruby_client/filestorage/types/meta_response.rb', line 21 def additional_properties @additional_properties end |
#has_conditional_params ⇒ Boolean (readonly)
17 18 19 |
# File 'lib/merge_ruby_client/filestorage/types/meta_response.rb', line 17 def has_conditional_params @has_conditional_params end |
#has_required_linked_account_params ⇒ Boolean (readonly)
19 20 21 |
# File 'lib/merge_ruby_client/filestorage/types/meta_response.rb', line 19 def has_required_linked_account_params @has_required_linked_account_params end |
#remote_field_classes ⇒ Hash{String => Object} (readonly)
13 14 15 |
# File 'lib/merge_ruby_client/filestorage/types/meta_response.rb', line 13 def remote_field_classes @remote_field_classes end |
#request_schema ⇒ Hash{String => Object} (readonly)
11 12 13 |
# File 'lib/merge_ruby_client/filestorage/types/meta_response.rb', line 11 def request_schema @request_schema end |
#status ⇒ Merge::Filestorage::LinkedAccountStatus (readonly)
15 16 17 |
# File 'lib/merge_ruby_client/filestorage/types/meta_response.rb', line 15 def status @status end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Filestorage::MetaResponse
Deserialize a JSON object to an instance of MetaResponse
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/merge_ruby_client/filestorage/types/meta_response.rb', line 58 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) request_schema = parsed_json["request_schema"] remote_field_classes = parsed_json["remote_field_classes"] if parsed_json["status"].nil? status = nil else status = parsed_json["status"].to_json status = Merge::Filestorage::LinkedAccountStatus.from_json(json_object: status) end has_conditional_params = parsed_json["has_conditional_params"] has_required_linked_account_params = parsed_json["has_required_linked_account_params"] new( request_schema: request_schema, remote_field_classes: remote_field_classes, status: status, has_conditional_params: has_conditional_params, has_required_linked_account_params: has_required_linked_account_params, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
94 95 96 97 98 99 100 |
# File 'lib/merge_ruby_client/filestorage/types/meta_response.rb', line 94 def self.validate_raw(obj:) obj.request_schema.is_a?(Hash) != false || raise("Passed value for field obj.request_schema is not the expected type, validation failed.") obj.remote_field_classes&.is_a?(Hash) != false || raise("Passed value for field obj.remote_field_classes is not the expected type, validation failed.") obj.status.nil? || Merge::Filestorage::LinkedAccountStatus.validate_raw(obj: obj.status) obj.has_conditional_params.is_a?(Boolean) != false || raise("Passed value for field obj.has_conditional_params is not the expected type, validation failed.") obj.has_required_linked_account_params.is_a?(Boolean) != false || raise("Passed value for field obj.has_required_linked_account_params is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of MetaResponse to a JSON object
84 85 86 |
# File 'lib/merge_ruby_client/filestorage/types/meta_response.rb', line 84 def to_json(*_args) @_field_set&.to_json end |