Class: Merge::Crm::RemoteFieldClassForCustomObjectClass
- Inherits:
-
Object
- Object
- Merge::Crm::RemoteFieldClassForCustomObjectClass
- Defined in:
- lib/merge_ruby_client/crm/types/remote_field_class_for_custom_object_class.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#created_at ⇒ DateTime
readonly
The datetime that this object was created by Merge.
- #description ⇒ String readonly
- #display_name ⇒ String readonly
- #field_choices ⇒ Array<Merge::Crm::RemoteFieldClassForCustomObjectClassFieldChoicesItem> readonly
- #field_format ⇒ Merge::Crm::FieldFormatEnum readonly
- #field_type ⇒ Merge::Crm::FieldTypeEnum readonly
- #is_required ⇒ Boolean readonly
- #item_schema ⇒ Merge::Crm::RemoteFieldClassForCustomObjectClassItemSchema readonly
-
#modified_at ⇒ DateTime
readonly
The datetime that this object was modified by Merge.
- #remote_key_name ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Crm::RemoteFieldClassForCustomObjectClass
Deserialize a JSON object to an instance of RemoteFieldClassForCustomObjectClass.
-
.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(created_at: OMIT, modified_at: OMIT, display_name: OMIT, remote_key_name: OMIT, description: OMIT, is_required: OMIT, field_type: OMIT, field_format: OMIT, field_choices: OMIT, item_schema: OMIT, additional_properties: nil) ⇒ Merge::Crm::RemoteFieldClassForCustomObjectClass constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of RemoteFieldClassForCustomObjectClass to a JSON object.
Constructor Details
#initialize(created_at: OMIT, modified_at: OMIT, display_name: OMIT, remote_key_name: OMIT, description: OMIT, is_required: OMIT, field_type: OMIT, field_format: OMIT, field_choices: OMIT, item_schema: OMIT, additional_properties: nil) ⇒ Merge::Crm::RemoteFieldClassForCustomObjectClass
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/merge_ruby_client/crm/types/remote_field_class_for_custom_object_class.rb', line 54 def initialize(created_at: OMIT, modified_at: OMIT, display_name: OMIT, remote_key_name: OMIT, description: OMIT, is_required: OMIT, field_type: OMIT, field_format: OMIT, field_choices: OMIT, item_schema: OMIT, additional_properties: nil) @created_at = created_at if created_at != OMIT @modified_at = modified_at if modified_at != OMIT @display_name = display_name if display_name != OMIT @remote_key_name = remote_key_name if remote_key_name != OMIT @description = description if description != OMIT @is_required = is_required if is_required != OMIT @field_type = field_type if field_type != OMIT @field_format = field_format if field_format != OMIT @field_choices = field_choices if field_choices != OMIT @item_schema = item_schema if item_schema != OMIT @additional_properties = additional_properties @_field_set = { "created_at": created_at, "modified_at": modified_at, "display_name": display_name, "remote_key_name": remote_key_name, "description": description, "is_required": is_required, "field_type": field_type, "field_format": field_format, "field_choices": field_choices, "item_schema": item_schema }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
35 36 37 |
# File 'lib/merge_ruby_client/crm/types/remote_field_class_for_custom_object_class.rb', line 35 def additional_properties @additional_properties end |
#created_at ⇒ DateTime (readonly)
Returns The datetime that this object was created by Merge.
15 16 17 |
# File 'lib/merge_ruby_client/crm/types/remote_field_class_for_custom_object_class.rb', line 15 def created_at @created_at end |
#description ⇒ String (readonly)
23 24 25 |
# File 'lib/merge_ruby_client/crm/types/remote_field_class_for_custom_object_class.rb', line 23 def description @description end |
#display_name ⇒ String (readonly)
19 20 21 |
# File 'lib/merge_ruby_client/crm/types/remote_field_class_for_custom_object_class.rb', line 19 def display_name @display_name end |
#field_choices ⇒ Array<Merge::Crm::RemoteFieldClassForCustomObjectClassFieldChoicesItem> (readonly)
31 32 33 |
# File 'lib/merge_ruby_client/crm/types/remote_field_class_for_custom_object_class.rb', line 31 def field_choices @field_choices end |
#field_format ⇒ Merge::Crm::FieldFormatEnum (readonly)
29 30 31 |
# File 'lib/merge_ruby_client/crm/types/remote_field_class_for_custom_object_class.rb', line 29 def field_format @field_format end |
#field_type ⇒ Merge::Crm::FieldTypeEnum (readonly)
27 28 29 |
# File 'lib/merge_ruby_client/crm/types/remote_field_class_for_custom_object_class.rb', line 27 def field_type @field_type end |
#is_required ⇒ Boolean (readonly)
25 26 27 |
# File 'lib/merge_ruby_client/crm/types/remote_field_class_for_custom_object_class.rb', line 25 def is_required @is_required end |
#item_schema ⇒ Merge::Crm::RemoteFieldClassForCustomObjectClassItemSchema (readonly)
33 34 35 |
# File 'lib/merge_ruby_client/crm/types/remote_field_class_for_custom_object_class.rb', line 33 def item_schema @item_schema end |
#modified_at ⇒ DateTime (readonly)
Returns The datetime that this object was modified by Merge.
17 18 19 |
# File 'lib/merge_ruby_client/crm/types/remote_field_class_for_custom_object_class.rb', line 17 def modified_at @modified_at end |
#remote_key_name ⇒ String (readonly)
21 22 23 |
# File 'lib/merge_ruby_client/crm/types/remote_field_class_for_custom_object_class.rb', line 21 def remote_key_name @remote_key_name end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Crm::RemoteFieldClassForCustomObjectClass
Deserialize a JSON object to an instance of RemoteFieldClassForCustomObjectClass
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/merge_ruby_client/crm/types/remote_field_class_for_custom_object_class.rb', line 87 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?) modified_at = (DateTime.parse(parsed_json["modified_at"]) unless parsed_json["modified_at"].nil?) display_name = parsed_json["display_name"] remote_key_name = parsed_json["remote_key_name"] description = parsed_json["description"] is_required = parsed_json["is_required"] field_type = parsed_json["field_type"] field_format = parsed_json["field_format"] field_choices = parsed_json["field_choices"]&.map do |item| item = item.to_json Merge::Crm::RemoteFieldClassForCustomObjectClassFieldChoicesItem.from_json(json_object: item) end if parsed_json["item_schema"].nil? item_schema = nil else item_schema = parsed_json["item_schema"].to_json item_schema = Merge::Crm::RemoteFieldClassForCustomObjectClassItemSchema.from_json(json_object: item_schema) end new( created_at: created_at, modified_at: modified_at, display_name: display_name, remote_key_name: remote_key_name, description: description, is_required: is_required, field_type: field_type, field_format: field_format, field_choices: field_choices, item_schema: item_schema, 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.
136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/merge_ruby_client/crm/types/remote_field_class_for_custom_object_class.rb', line 136 def self.validate_raw(obj:) obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.") obj.modified_at&.is_a?(DateTime) != false || raise("Passed value for field obj.modified_at is not the expected type, validation failed.") obj.display_name&.is_a?(String) != false || raise("Passed value for field obj.display_name is not the expected type, validation failed.") obj.remote_key_name&.is_a?(String) != false || raise("Passed value for field obj.remote_key_name is not the expected type, validation failed.") obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.") obj.is_required&.is_a?(Boolean) != false || raise("Passed value for field obj.is_required is not the expected type, validation failed.") obj.field_type&.is_a?(Merge::Crm::FieldTypeEnum) != false || raise("Passed value for field obj.field_type is not the expected type, validation failed.") obj.field_format&.is_a?(Merge::Crm::FieldFormatEnum) != false || raise("Passed value for field obj.field_format is not the expected type, validation failed.") obj.field_choices&.is_a?(Array) != false || raise("Passed value for field obj.field_choices is not the expected type, validation failed.") obj.item_schema.nil? || Merge::Crm::RemoteFieldClassForCustomObjectClassItemSchema.validate_raw(obj: obj.item_schema) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of RemoteFieldClassForCustomObjectClass to a JSON object
126 127 128 |
# File 'lib/merge_ruby_client/crm/types/remote_field_class_for_custom_object_class.rb', line 126 def to_json(*_args) @_field_set&.to_json end |