Class: Merge::Crm::CommonModelScopesBodyRequest
- Inherits:
-
Object
- Object
- Merge::Crm::CommonModelScopesBodyRequest
- Defined in:
- lib/merge_ruby_client/crm/types/common_model_scopes_body_request.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #disabled_fields ⇒ Array<String> readonly
- #enabled_actions ⇒ Array<Merge::Crm::EnabledActionsEnum> readonly
- #model_id ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Crm::CommonModelScopesBodyRequest
Deserialize a JSON object to an instance of CommonModelScopesBodyRequest.
-
.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(model_id:, enabled_actions:, disabled_fields:, additional_properties: nil) ⇒ Merge::Crm::CommonModelScopesBodyRequest constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CommonModelScopesBodyRequest to a JSON object.
Constructor Details
#initialize(model_id:, enabled_actions:, disabled_fields:, additional_properties: nil) ⇒ Merge::Crm::CommonModelScopesBodyRequest
29 30 31 32 33 34 35 |
# File 'lib/merge_ruby_client/crm/types/common_model_scopes_body_request.rb', line 29 def initialize(model_id:, enabled_actions:, disabled_fields:, additional_properties: nil) @model_id = model_id @enabled_actions = enabled_actions @disabled_fields = disabled_fields @additional_properties = additional_properties @_field_set = { "model_id": model_id, "enabled_actions": enabled_actions, "disabled_fields": disabled_fields } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
17 18 19 |
# File 'lib/merge_ruby_client/crm/types/common_model_scopes_body_request.rb', line 17 def additional_properties @additional_properties end |
#disabled_fields ⇒ Array<String> (readonly)
15 16 17 |
# File 'lib/merge_ruby_client/crm/types/common_model_scopes_body_request.rb', line 15 def disabled_fields @disabled_fields end |
#enabled_actions ⇒ Array<Merge::Crm::EnabledActionsEnum> (readonly)
13 14 15 |
# File 'lib/merge_ruby_client/crm/types/common_model_scopes_body_request.rb', line 13 def enabled_actions @enabled_actions end |
#model_id ⇒ String (readonly)
11 12 13 |
# File 'lib/merge_ruby_client/crm/types/common_model_scopes_body_request.rb', line 11 def model_id @model_id end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Crm::CommonModelScopesBodyRequest
Deserialize a JSON object to an instance of CommonModelScopesBodyRequest
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/merge_ruby_client/crm/types/common_model_scopes_body_request.rb', line 41 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) model_id = parsed_json["model_id"] enabled_actions = parsed_json["enabled_actions"] disabled_fields = parsed_json["disabled_fields"] new( model_id: model_id, enabled_actions: enabled_actions, disabled_fields: disabled_fields, 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.
68 69 70 71 72 |
# File 'lib/merge_ruby_client/crm/types/common_model_scopes_body_request.rb', line 68 def self.validate_raw(obj:) obj.model_id.is_a?(String) != false || raise("Passed value for field obj.model_id is not the expected type, validation failed.") obj.enabled_actions.is_a?(Array) != false || raise("Passed value for field obj.enabled_actions is not the expected type, validation failed.") obj.disabled_fields.is_a?(Array) != false || raise("Passed value for field obj.disabled_fields is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of CommonModelScopesBodyRequest to a JSON object
58 59 60 |
# File 'lib/merge_ruby_client/crm/types/common_model_scopes_body_request.rb', line 58 def to_json(*_args) @_field_set&.to_json end |