late-sdk 0.0.88 → 0.0.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,6 +19,162 @@ module Late
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Add reaction
23
+ # Add an emoji reaction to a message. Platform support: - **Telegram**: Supports a subset of Unicode emoji reactions - **WhatsApp**: Supports any standard emoji (one reaction per message per sender) - **All others**: Returns 400 (not supported)
24
+ # @param conversation_id [String] The conversation ID
25
+ # @param message_id [String] The platform message ID to react to
26
+ # @param add_message_reaction_request [AddMessageReactionRequest]
27
+ # @param [Hash] opts the optional parameters
28
+ # @return [UpdateRedditSubreddits200Response]
29
+ def add_message_reaction(conversation_id, message_id, add_message_reaction_request, opts = {})
30
+ data, _status_code, _headers = add_message_reaction_with_http_info(conversation_id, message_id, add_message_reaction_request, opts)
31
+ data
32
+ end
33
+
34
+ # Add reaction
35
+ # Add an emoji reaction to a message. Platform support: - **Telegram**: Supports a subset of Unicode emoji reactions - **WhatsApp**: Supports any standard emoji (one reaction per message per sender) - **All others**: Returns 400 (not supported)
36
+ # @param conversation_id [String] The conversation ID
37
+ # @param message_id [String] The platform message ID to react to
38
+ # @param add_message_reaction_request [AddMessageReactionRequest]
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [Array<(UpdateRedditSubreddits200Response, Integer, Hash)>] UpdateRedditSubreddits200Response data, response status code and response headers
41
+ def add_message_reaction_with_http_info(conversation_id, message_id, add_message_reaction_request, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: MessagesApi.add_message_reaction ...'
44
+ end
45
+ # verify the required parameter 'conversation_id' is set
46
+ if @api_client.config.client_side_validation && conversation_id.nil?
47
+ fail ArgumentError, "Missing the required parameter 'conversation_id' when calling MessagesApi.add_message_reaction"
48
+ end
49
+ # verify the required parameter 'message_id' is set
50
+ if @api_client.config.client_side_validation && message_id.nil?
51
+ fail ArgumentError, "Missing the required parameter 'message_id' when calling MessagesApi.add_message_reaction"
52
+ end
53
+ # verify the required parameter 'add_message_reaction_request' is set
54
+ if @api_client.config.client_side_validation && add_message_reaction_request.nil?
55
+ fail ArgumentError, "Missing the required parameter 'add_message_reaction_request' when calling MessagesApi.add_message_reaction"
56
+ end
57
+ # resource path
58
+ local_var_path = '/v1/inbox/conversations/{conversationId}/messages/{messageId}/reactions'.sub('{' + 'conversationId' + '}', CGI.escape(conversation_id.to_s)).sub('{' + 'messageId' + '}', CGI.escape(message_id.to_s))
59
+
60
+ # query parameters
61
+ query_params = opts[:query_params] || {}
62
+
63
+ # header parameters
64
+ header_params = opts[:header_params] || {}
65
+ # HTTP header 'Accept' (if needed)
66
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
67
+ # HTTP header 'Content-Type'
68
+ content_type = @api_client.select_header_content_type(['application/json'])
69
+ if !content_type.nil?
70
+ header_params['Content-Type'] = content_type
71
+ end
72
+
73
+ # form parameters
74
+ form_params = opts[:form_params] || {}
75
+
76
+ # http body (model)
77
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(add_message_reaction_request)
78
+
79
+ # return_type
80
+ return_type = opts[:debug_return_type] || 'UpdateRedditSubreddits200Response'
81
+
82
+ # auth_names
83
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
84
+
85
+ new_options = opts.merge(
86
+ :operation => :"MessagesApi.add_message_reaction",
87
+ :header_params => header_params,
88
+ :query_params => query_params,
89
+ :form_params => form_params,
90
+ :body => post_body,
91
+ :auth_names => auth_names,
92
+ :return_type => return_type
93
+ )
94
+
95
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
96
+ if @api_client.config.debugging
97
+ @api_client.config.logger.debug "API called: MessagesApi#add_message_reaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
98
+ end
99
+ return data, status_code, headers
100
+ end
101
+
102
+ # Delete message
103
+ # Delete a message from a conversation. Platform support varies: - **Telegram**: Full delete (bot's own messages anytime, others if admin) - **X/Twitter**: Full delete (own DM events only) - **Bluesky**: Delete for self only (recipient still sees it) - **Reddit**: Delete from sender's view only - **Facebook, Instagram, WhatsApp**: Not supported (returns 400)
104
+ # @param conversation_id [String] The conversation ID
105
+ # @param message_id [String] The platform message ID to delete
106
+ # @param account_id [String] Social account ID
107
+ # @param [Hash] opts the optional parameters
108
+ # @return [UpdateRedditSubreddits200Response]
109
+ def delete_inbox_message(conversation_id, message_id, account_id, opts = {})
110
+ data, _status_code, _headers = delete_inbox_message_with_http_info(conversation_id, message_id, account_id, opts)
111
+ data
112
+ end
113
+
114
+ # Delete message
115
+ # Delete a message from a conversation. Platform support varies: - **Telegram**: Full delete (bot&#39;s own messages anytime, others if admin) - **X/Twitter**: Full delete (own DM events only) - **Bluesky**: Delete for self only (recipient still sees it) - **Reddit**: Delete from sender&#39;s view only - **Facebook, Instagram, WhatsApp**: Not supported (returns 400)
116
+ # @param conversation_id [String] The conversation ID
117
+ # @param message_id [String] The platform message ID to delete
118
+ # @param account_id [String] Social account ID
119
+ # @param [Hash] opts the optional parameters
120
+ # @return [Array<(UpdateRedditSubreddits200Response, Integer, Hash)>] UpdateRedditSubreddits200Response data, response status code and response headers
121
+ def delete_inbox_message_with_http_info(conversation_id, message_id, account_id, opts = {})
122
+ if @api_client.config.debugging
123
+ @api_client.config.logger.debug 'Calling API: MessagesApi.delete_inbox_message ...'
124
+ end
125
+ # verify the required parameter 'conversation_id' is set
126
+ if @api_client.config.client_side_validation && conversation_id.nil?
127
+ fail ArgumentError, "Missing the required parameter 'conversation_id' when calling MessagesApi.delete_inbox_message"
128
+ end
129
+ # verify the required parameter 'message_id' is set
130
+ if @api_client.config.client_side_validation && message_id.nil?
131
+ fail ArgumentError, "Missing the required parameter 'message_id' when calling MessagesApi.delete_inbox_message"
132
+ end
133
+ # verify the required parameter 'account_id' is set
134
+ if @api_client.config.client_side_validation && account_id.nil?
135
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling MessagesApi.delete_inbox_message"
136
+ end
137
+ # resource path
138
+ local_var_path = '/v1/inbox/conversations/{conversationId}/messages/{messageId}'.sub('{' + 'conversationId' + '}', CGI.escape(conversation_id.to_s)).sub('{' + 'messageId' + '}', CGI.escape(message_id.to_s))
139
+
140
+ # query parameters
141
+ query_params = opts[:query_params] || {}
142
+ query_params[:'accountId'] = account_id
143
+
144
+ # header parameters
145
+ header_params = opts[:header_params] || {}
146
+ # HTTP header 'Accept' (if needed)
147
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
148
+
149
+ # form parameters
150
+ form_params = opts[:form_params] || {}
151
+
152
+ # http body (model)
153
+ post_body = opts[:debug_body]
154
+
155
+ # return_type
156
+ return_type = opts[:debug_return_type] || 'UpdateRedditSubreddits200Response'
157
+
158
+ # auth_names
159
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
160
+
161
+ new_options = opts.merge(
162
+ :operation => :"MessagesApi.delete_inbox_message",
163
+ :header_params => header_params,
164
+ :query_params => query_params,
165
+ :form_params => form_params,
166
+ :body => post_body,
167
+ :auth_names => auth_names,
168
+ :return_type => return_type
169
+ )
170
+
171
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
172
+ if @api_client.config.debugging
173
+ @api_client.config.logger.debug "API called: MessagesApi#delete_inbox_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
174
+ end
175
+ return data, status_code, headers
176
+ end
177
+
22
178
  # Edit message
23
179
  # Edit the text and/or reply markup of a previously sent Telegram message. Only supported for Telegram. Returns 400 for other platforms.
24
180
  # @param conversation_id [String] The conversation ID
@@ -337,6 +493,82 @@ module Late
337
493
  return data, status_code, headers
338
494
  end
339
495
 
496
+ # Remove reaction
497
+ # Remove a reaction from a message. Platform support: - **Telegram**: Send empty reaction array to clear - **WhatsApp**: Send empty emoji to remove - **All others**: Returns 400 (not supported)
498
+ # @param conversation_id [String] The conversation ID
499
+ # @param message_id [String] The platform message ID
500
+ # @param account_id [String] Social account ID
501
+ # @param [Hash] opts the optional parameters
502
+ # @return [UpdateRedditSubreddits200Response]
503
+ def remove_message_reaction(conversation_id, message_id, account_id, opts = {})
504
+ data, _status_code, _headers = remove_message_reaction_with_http_info(conversation_id, message_id, account_id, opts)
505
+ data
506
+ end
507
+
508
+ # Remove reaction
509
+ # Remove a reaction from a message. Platform support: - **Telegram**: Send empty reaction array to clear - **WhatsApp**: Send empty emoji to remove - **All others**: Returns 400 (not supported)
510
+ # @param conversation_id [String] The conversation ID
511
+ # @param message_id [String] The platform message ID
512
+ # @param account_id [String] Social account ID
513
+ # @param [Hash] opts the optional parameters
514
+ # @return [Array<(UpdateRedditSubreddits200Response, Integer, Hash)>] UpdateRedditSubreddits200Response data, response status code and response headers
515
+ def remove_message_reaction_with_http_info(conversation_id, message_id, account_id, opts = {})
516
+ if @api_client.config.debugging
517
+ @api_client.config.logger.debug 'Calling API: MessagesApi.remove_message_reaction ...'
518
+ end
519
+ # verify the required parameter 'conversation_id' is set
520
+ if @api_client.config.client_side_validation && conversation_id.nil?
521
+ fail ArgumentError, "Missing the required parameter 'conversation_id' when calling MessagesApi.remove_message_reaction"
522
+ end
523
+ # verify the required parameter 'message_id' is set
524
+ if @api_client.config.client_side_validation && message_id.nil?
525
+ fail ArgumentError, "Missing the required parameter 'message_id' when calling MessagesApi.remove_message_reaction"
526
+ end
527
+ # verify the required parameter 'account_id' is set
528
+ if @api_client.config.client_side_validation && account_id.nil?
529
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling MessagesApi.remove_message_reaction"
530
+ end
531
+ # resource path
532
+ local_var_path = '/v1/inbox/conversations/{conversationId}/messages/{messageId}/reactions'.sub('{' + 'conversationId' + '}', CGI.escape(conversation_id.to_s)).sub('{' + 'messageId' + '}', CGI.escape(message_id.to_s))
533
+
534
+ # query parameters
535
+ query_params = opts[:query_params] || {}
536
+ query_params[:'accountId'] = account_id
537
+
538
+ # header parameters
539
+ header_params = opts[:header_params] || {}
540
+ # HTTP header 'Accept' (if needed)
541
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
542
+
543
+ # form parameters
544
+ form_params = opts[:form_params] || {}
545
+
546
+ # http body (model)
547
+ post_body = opts[:debug_body]
548
+
549
+ # return_type
550
+ return_type = opts[:debug_return_type] || 'UpdateRedditSubreddits200Response'
551
+
552
+ # auth_names
553
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
554
+
555
+ new_options = opts.merge(
556
+ :operation => :"MessagesApi.remove_message_reaction",
557
+ :header_params => header_params,
558
+ :query_params => query_params,
559
+ :form_params => form_params,
560
+ :body => post_body,
561
+ :auth_names => auth_names,
562
+ :return_type => return_type
563
+ )
564
+
565
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
566
+ if @api_client.config.debugging
567
+ @api_client.config.logger.debug "API called: MessagesApi#remove_message_reaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
568
+ end
569
+ return data, status_code, headers
570
+ end
571
+
340
572
  # Send message
341
573
  # Send a message in a conversation. Supports text, attachments, quick replies, buttons, and message tags. Attachment and interactive message support varies by platform.
342
574
  # @param conversation_id [String] The conversation ID (id field from list conversations endpoint). This is the platform-specific conversation identifier, not an internal database ID.
@@ -411,6 +643,80 @@ module Late
411
643
  return data, status_code, headers
412
644
  end
413
645
 
646
+ # Send typing indicator
647
+ # Show a typing indicator in a conversation. Platform support: - **Facebook Messenger**: Shows \"Page is typing...\" for 20 seconds - **Telegram**: Shows \"Bot is typing...\" for 5 seconds - **All others**: Returns 200 but no-op (platform doesn't support it) Typing indicators are best-effort. The endpoint always returns 200 even if the platform call fails.
648
+ # @param conversation_id [String] The conversation ID
649
+ # @param send_typing_indicator_request [SendTypingIndicatorRequest]
650
+ # @param [Hash] opts the optional parameters
651
+ # @return [UpdateRedditSubreddits200Response]
652
+ def send_typing_indicator(conversation_id, send_typing_indicator_request, opts = {})
653
+ data, _status_code, _headers = send_typing_indicator_with_http_info(conversation_id, send_typing_indicator_request, opts)
654
+ data
655
+ end
656
+
657
+ # Send typing indicator
658
+ # Show a typing indicator in a conversation. Platform support: - **Facebook Messenger**: Shows \&quot;Page is typing...\&quot; for 20 seconds - **Telegram**: Shows \&quot;Bot is typing...\&quot; for 5 seconds - **All others**: Returns 200 but no-op (platform doesn&#39;t support it) Typing indicators are best-effort. The endpoint always returns 200 even if the platform call fails.
659
+ # @param conversation_id [String] The conversation ID
660
+ # @param send_typing_indicator_request [SendTypingIndicatorRequest]
661
+ # @param [Hash] opts the optional parameters
662
+ # @return [Array<(UpdateRedditSubreddits200Response, Integer, Hash)>] UpdateRedditSubreddits200Response data, response status code and response headers
663
+ def send_typing_indicator_with_http_info(conversation_id, send_typing_indicator_request, opts = {})
664
+ if @api_client.config.debugging
665
+ @api_client.config.logger.debug 'Calling API: MessagesApi.send_typing_indicator ...'
666
+ end
667
+ # verify the required parameter 'conversation_id' is set
668
+ if @api_client.config.client_side_validation && conversation_id.nil?
669
+ fail ArgumentError, "Missing the required parameter 'conversation_id' when calling MessagesApi.send_typing_indicator"
670
+ end
671
+ # verify the required parameter 'send_typing_indicator_request' is set
672
+ if @api_client.config.client_side_validation && send_typing_indicator_request.nil?
673
+ fail ArgumentError, "Missing the required parameter 'send_typing_indicator_request' when calling MessagesApi.send_typing_indicator"
674
+ end
675
+ # resource path
676
+ local_var_path = '/v1/inbox/conversations/{conversationId}/typing'.sub('{' + 'conversationId' + '}', CGI.escape(conversation_id.to_s))
677
+
678
+ # query parameters
679
+ query_params = opts[:query_params] || {}
680
+
681
+ # header parameters
682
+ header_params = opts[:header_params] || {}
683
+ # HTTP header 'Accept' (if needed)
684
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
685
+ # HTTP header 'Content-Type'
686
+ content_type = @api_client.select_header_content_type(['application/json'])
687
+ if !content_type.nil?
688
+ header_params['Content-Type'] = content_type
689
+ end
690
+
691
+ # form parameters
692
+ form_params = opts[:form_params] || {}
693
+
694
+ # http body (model)
695
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(send_typing_indicator_request)
696
+
697
+ # return_type
698
+ return_type = opts[:debug_return_type] || 'UpdateRedditSubreddits200Response'
699
+
700
+ # auth_names
701
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
702
+
703
+ new_options = opts.merge(
704
+ :operation => :"MessagesApi.send_typing_indicator",
705
+ :header_params => header_params,
706
+ :query_params => query_params,
707
+ :form_params => form_params,
708
+ :body => post_body,
709
+ :auth_names => auth_names,
710
+ :return_type => return_type
711
+ )
712
+
713
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
714
+ if @api_client.config.debugging
715
+ @api_client.config.logger.debug "API called: MessagesApi#send_typing_indicator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
716
+ end
717
+ return data, status_code, headers
718
+ end
719
+
414
720
  # Update conversation status
415
721
  # Archive or activate a conversation. Requires accountId in request body.
416
722
  # @param conversation_id [String] The conversation ID (id field from list conversations endpoint). This is the platform-specific conversation identifier, not an internal database ID.
@@ -484,5 +790,77 @@ module Late
484
790
  end
485
791
  return data, status_code, headers
486
792
  end
793
+
794
+ # Upload media file
795
+ # Upload a media file using API key authentication and get back a publicly accessible URL. The URL can be used as `attachmentUrl` when sending inbox messages. Files are stored in temporary storage and auto-delete after 7 days. Maximum file size is 25MB. Unlike `/v1/media/upload` (which uses upload tokens for end-user flows), this endpoint uses standard Bearer token authentication for programmatic use.
796
+ # @param file [File] The file to upload (max 25MB)
797
+ # @param [Hash] opts the optional parameters
798
+ # @option opts [String] :content_type Override MIME type (e.g. \\\&quot;image/jpeg\\\&quot;). Auto-detected from file if not provided.
799
+ # @return [UploadMediaDirect200Response]
800
+ def upload_media_direct(file, opts = {})
801
+ data, _status_code, _headers = upload_media_direct_with_http_info(file, opts)
802
+ data
803
+ end
804
+
805
+ # Upload media file
806
+ # Upload a media file using API key authentication and get back a publicly accessible URL. The URL can be used as &#x60;attachmentUrl&#x60; when sending inbox messages. Files are stored in temporary storage and auto-delete after 7 days. Maximum file size is 25MB. Unlike &#x60;/v1/media/upload&#x60; (which uses upload tokens for end-user flows), this endpoint uses standard Bearer token authentication for programmatic use.
807
+ # @param file [File] The file to upload (max 25MB)
808
+ # @param [Hash] opts the optional parameters
809
+ # @option opts [String] :content_type Override MIME type (e.g. \\\&quot;image/jpeg\\\&quot;). Auto-detected from file if not provided.
810
+ # @return [Array<(UploadMediaDirect200Response, Integer, Hash)>] UploadMediaDirect200Response data, response status code and response headers
811
+ def upload_media_direct_with_http_info(file, opts = {})
812
+ if @api_client.config.debugging
813
+ @api_client.config.logger.debug 'Calling API: MessagesApi.upload_media_direct ...'
814
+ end
815
+ # verify the required parameter 'file' is set
816
+ if @api_client.config.client_side_validation && file.nil?
817
+ fail ArgumentError, "Missing the required parameter 'file' when calling MessagesApi.upload_media_direct"
818
+ end
819
+ # resource path
820
+ local_var_path = '/v1/media/upload-direct'
821
+
822
+ # query parameters
823
+ query_params = opts[:query_params] || {}
824
+
825
+ # header parameters
826
+ header_params = opts[:header_params] || {}
827
+ # HTTP header 'Accept' (if needed)
828
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
829
+ # HTTP header 'Content-Type'
830
+ content_type = @api_client.select_header_content_type(['multipart/form-data'])
831
+ if !content_type.nil?
832
+ header_params['Content-Type'] = content_type
833
+ end
834
+
835
+ # form parameters
836
+ form_params = opts[:form_params] || {}
837
+ form_params['file'] = file
838
+ form_params['contentType'] = opts[:'content_type'] if !opts[:'content_type'].nil?
839
+
840
+ # http body (model)
841
+ post_body = opts[:debug_body]
842
+
843
+ # return_type
844
+ return_type = opts[:debug_return_type] || 'UploadMediaDirect200Response'
845
+
846
+ # auth_names
847
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
848
+
849
+ new_options = opts.merge(
850
+ :operation => :"MessagesApi.upload_media_direct",
851
+ :header_params => header_params,
852
+ :query_params => query_params,
853
+ :form_params => form_params,
854
+ :body => post_body,
855
+ :auth_names => auth_names,
856
+ :return_type => return_type
857
+ )
858
+
859
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
860
+ if @api_client.config.debugging
861
+ @api_client.config.logger.debug "API called: MessagesApi#upload_media_direct\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
862
+ end
863
+ return data, status_code, headers
864
+ end
487
865
  end
488
866
  end
@@ -0,0 +1,192 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Late
17
+ class AddMessageReactionRequest < ApiModelBase
18
+ # Social account ID
19
+ attr_accessor :account_id
20
+
21
+ # Emoji character (e.g. \"👍\", \"❤️\")
22
+ attr_accessor :emoji
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'account_id' => :'accountId',
28
+ :'emoji' => :'emoji'
29
+ }
30
+ end
31
+
32
+ # Returns attribute mapping this model knows about
33
+ def self.acceptable_attribute_map
34
+ attribute_map
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ acceptable_attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'account_id' => :'String',
46
+ :'emoji' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::AddMessageReactionRequest` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ acceptable_attribute_map = self.class.acceptable_attribute_map
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!acceptable_attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::AddMessageReactionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'account_id')
73
+ self.account_id = attributes[:'account_id']
74
+ else
75
+ self.account_id = nil
76
+ end
77
+
78
+ if attributes.key?(:'emoji')
79
+ self.emoji = attributes[:'emoji']
80
+ else
81
+ self.emoji = nil
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
89
+ invalid_properties = Array.new
90
+ if @account_id.nil?
91
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
92
+ end
93
+
94
+ if @emoji.nil?
95
+ invalid_properties.push('invalid value for "emoji", emoji cannot be nil.')
96
+ end
97
+
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ warn '[DEPRECATED] the `valid?` method is obsolete'
105
+ return false if @account_id.nil?
106
+ return false if @emoji.nil?
107
+ true
108
+ end
109
+
110
+ # Custom attribute writer method with validation
111
+ # @param [Object] account_id Value to be assigned
112
+ def account_id=(account_id)
113
+ if account_id.nil?
114
+ fail ArgumentError, 'account_id cannot be nil'
115
+ end
116
+
117
+ @account_id = account_id
118
+ end
119
+
120
+ # Custom attribute writer method with validation
121
+ # @param [Object] emoji Value to be assigned
122
+ def emoji=(emoji)
123
+ if emoji.nil?
124
+ fail ArgumentError, 'emoji cannot be nil'
125
+ end
126
+
127
+ @emoji = emoji
128
+ end
129
+
130
+ # Checks equality by comparing each attribute.
131
+ # @param [Object] Object to be compared
132
+ def ==(o)
133
+ return true if self.equal?(o)
134
+ self.class == o.class &&
135
+ account_id == o.account_id &&
136
+ emoji == o.emoji
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Integer] Hash code
147
+ def hash
148
+ [account_id, emoji].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def self.build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ attributes = attributes.transform_keys(&:to_sym)
157
+ transformed_hash = {}
158
+ openapi_types.each_pair do |key, type|
159
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = nil
161
+ elsif type =~ /\AArray<(.*)>/i
162
+ # check to ensure the input is an array given that the attribute
163
+ # is documented as an array but the input is not
164
+ if attributes[attribute_map[key]].is_a?(Array)
165
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
166
+ end
167
+ elsif !attributes[attribute_map[key]].nil?
168
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
169
+ end
170
+ end
171
+ new(transformed_hash)
172
+ end
173
+
174
+ # Returns the object in the form of hash
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ self.class.attribute_map.each_pair do |attr, param|
179
+ value = self.send(attr)
180
+ if value.nil?
181
+ is_nullable = self.class.openapi_nullable.include?(attr)
182
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
183
+ end
184
+
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ end
191
+
192
+ end