Class: Merge::Crm::PatchedEngagementRequest
- Inherits:
-
Object
- Object
- Merge::Crm::PatchedEngagementRequest
- Defined in:
- lib/merge_ruby_client/crm/types/patched_engagement_request.rb
Overview
# The Engagement Object
### Description
The `Engagement` object is used to represent an interaction noted in a CRM
system.
### Usage Example
TODO
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#account ⇒ String
readonly
The account of the engagement.
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #contacts ⇒ Array<String> readonly
-
#content ⇒ String
readonly
The engagement’s content.
-
#direction ⇒ Merge::Crm::DirectionEnum
readonly
The engagement’s direction.
-
#end_time ⇒ DateTime
readonly
The time at which the engagement ended.
-
#engagement_type ⇒ String
readonly
The engagement type of the engagement.
- #integration_params ⇒ Hash{String => Object} readonly
- #linked_account_params ⇒ Hash{String => Object} readonly
-
#owner ⇒ String
readonly
The engagement’s owner.
- #remote_fields ⇒ Array<Merge::Crm::RemoteFieldRequest> readonly
-
#start_time ⇒ DateTime
readonly
The time at which the engagement started.
-
#subject ⇒ String
readonly
The engagement’s subject.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Crm::PatchedEngagementRequest
Deserialize a JSON object to an instance of PatchedEngagementRequest.
-
.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(owner: OMIT, content: OMIT, subject: OMIT, direction: OMIT, engagement_type: OMIT, start_time: OMIT, end_time: OMIT, account: OMIT, contacts: OMIT, integration_params: OMIT, linked_account_params: OMIT, remote_fields: OMIT, additional_properties: nil) ⇒ Merge::Crm::PatchedEngagementRequest constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of PatchedEngagementRequest to a JSON object.
Constructor Details
#initialize(owner: OMIT, content: OMIT, subject: OMIT, direction: OMIT, engagement_type: OMIT, start_time: OMIT, end_time: OMIT, account: OMIT, contacts: OMIT, integration_params: OMIT, linked_account_params: OMIT, remote_fields: OMIT, additional_properties: nil) ⇒ Merge::Crm::PatchedEngagementRequest
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/merge_ruby_client/crm/types/patched_engagement_request.rb', line 68 def initialize(owner: OMIT, content: OMIT, subject: OMIT, direction: OMIT, engagement_type: OMIT, start_time: OMIT, end_time: OMIT, account: OMIT, contacts: OMIT, integration_params: OMIT, linked_account_params: OMIT, remote_fields: OMIT, additional_properties: nil) @owner = owner if owner != OMIT @content = content if content != OMIT @subject = subject if subject != OMIT @direction = direction if direction != OMIT @engagement_type = engagement_type if engagement_type != OMIT @start_time = start_time if start_time != OMIT @end_time = end_time if end_time != OMIT @account = account if account != OMIT @contacts = contacts if contacts != OMIT @integration_params = integration_params if integration_params != OMIT @linked_account_params = linked_account_params if linked_account_params != OMIT @remote_fields = remote_fields if remote_fields != OMIT @additional_properties = additional_properties @_field_set = { "owner": owner, "content": content, "subject": subject, "direction": direction, "engagement_type": engagement_type, "start_time": start_time, "end_time": end_time, "account": account, "contacts": contacts, "integration_params": integration_params, "linked_account_params": linked_account_params, "remote_fields": remote_fields }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#account ⇒ String (readonly)
Returns The account of the engagement.
35 36 37 |
# File 'lib/merge_ruby_client/crm/types/patched_engagement_request.rb', line 35 def account @account end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
45 46 47 |
# File 'lib/merge_ruby_client/crm/types/patched_engagement_request.rb', line 45 def additional_properties @additional_properties end |
#contacts ⇒ Array<String> (readonly)
37 38 39 |
# File 'lib/merge_ruby_client/crm/types/patched_engagement_request.rb', line 37 def contacts @contacts end |
#content ⇒ String (readonly)
Returns The engagement’s content.
21 22 23 |
# File 'lib/merge_ruby_client/crm/types/patched_engagement_request.rb', line 21 def content @content end |
#direction ⇒ Merge::Crm::DirectionEnum (readonly)
Returns The engagement’s direction.
-
‘INBOUND` - INBOUND
-
‘OUTBOUND` - OUTBOUND.
27 28 29 |
# File 'lib/merge_ruby_client/crm/types/patched_engagement_request.rb', line 27 def direction @direction end |
#end_time ⇒ DateTime (readonly)
Returns The time at which the engagement ended.
33 34 35 |
# File 'lib/merge_ruby_client/crm/types/patched_engagement_request.rb', line 33 def end_time @end_time end |
#engagement_type ⇒ String (readonly)
Returns The engagement type of the engagement.
29 30 31 |
# File 'lib/merge_ruby_client/crm/types/patched_engagement_request.rb', line 29 def engagement_type @engagement_type end |
#integration_params ⇒ Hash{String => Object} (readonly)
39 40 41 |
# File 'lib/merge_ruby_client/crm/types/patched_engagement_request.rb', line 39 def integration_params @integration_params end |
#linked_account_params ⇒ Hash{String => Object} (readonly)
41 42 43 |
# File 'lib/merge_ruby_client/crm/types/patched_engagement_request.rb', line 41 def linked_account_params @linked_account_params end |
#owner ⇒ String (readonly)
Returns The engagement’s owner.
19 20 21 |
# File 'lib/merge_ruby_client/crm/types/patched_engagement_request.rb', line 19 def owner @owner end |
#remote_fields ⇒ Array<Merge::Crm::RemoteFieldRequest> (readonly)
43 44 45 |
# File 'lib/merge_ruby_client/crm/types/patched_engagement_request.rb', line 43 def remote_fields @remote_fields end |
#start_time ⇒ DateTime (readonly)
Returns The time at which the engagement started.
31 32 33 |
# File 'lib/merge_ruby_client/crm/types/patched_engagement_request.rb', line 31 def start_time @start_time end |
#subject ⇒ String (readonly)
Returns The engagement’s subject.
23 24 25 |
# File 'lib/merge_ruby_client/crm/types/patched_engagement_request.rb', line 23 def subject @subject end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Crm::PatchedEngagementRequest
Deserialize a JSON object to an instance of PatchedEngagementRequest
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/merge_ruby_client/crm/types/patched_engagement_request.rb', line 105 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) owner = parsed_json["owner"] content = parsed_json["content"] subject = parsed_json["subject"] direction = parsed_json["direction"] engagement_type = parsed_json["engagement_type"] start_time = (DateTime.parse(parsed_json["start_time"]) unless parsed_json["start_time"].nil?) end_time = (DateTime.parse(parsed_json["end_time"]) unless parsed_json["end_time"].nil?) account = parsed_json["account"] contacts = parsed_json["contacts"] integration_params = parsed_json["integration_params"] linked_account_params = parsed_json["linked_account_params"] remote_fields = parsed_json["remote_fields"]&.map do |item| item = item.to_json Merge::Crm::RemoteFieldRequest.from_json(json_object: item) end new( owner: owner, content: content, subject: subject, direction: direction, engagement_type: engagement_type, start_time: start_time, end_time: end_time, account: account, contacts: contacts, integration_params: integration_params, linked_account_params: linked_account_params, remote_fields: remote_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.
153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/merge_ruby_client/crm/types/patched_engagement_request.rb', line 153 def self.validate_raw(obj:) obj.owner&.is_a?(String) != false || raise("Passed value for field obj.owner is not the expected type, validation failed.") obj.content&.is_a?(String) != false || raise("Passed value for field obj.content is not the expected type, validation failed.") obj.subject&.is_a?(String) != false || raise("Passed value for field obj.subject is not the expected type, validation failed.") obj.direction&.is_a?(Merge::Crm::DirectionEnum) != false || raise("Passed value for field obj.direction is not the expected type, validation failed.") obj.engagement_type&.is_a?(String) != false || raise("Passed value for field obj.engagement_type is not the expected type, validation failed.") obj.start_time&.is_a?(DateTime) != false || raise("Passed value for field obj.start_time is not the expected type, validation failed.") obj.end_time&.is_a?(DateTime) != false || raise("Passed value for field obj.end_time is not the expected type, validation failed.") obj.account&.is_a?(String) != false || raise("Passed value for field obj.account is not the expected type, validation failed.") obj.contacts&.is_a?(Array) != false || raise("Passed value for field obj.contacts is not the expected type, validation failed.") obj.integration_params&.is_a?(Hash) != false || raise("Passed value for field obj.integration_params is not the expected type, validation failed.") obj.linked_account_params&.is_a?(Hash) != false || raise("Passed value for field obj.linked_account_params is not the expected type, validation failed.") obj.remote_fields&.is_a?(Array) != false || raise("Passed value for field obj.remote_fields is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of PatchedEngagementRequest to a JSON object
143 144 145 |
# File 'lib/merge_ruby_client/crm/types/patched_engagement_request.rb', line 143 def to_json(*_args) @_field_set&.to_json end |