sunshine-conversations-client 9.12.0 → 9.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG_RB.md +11 -0
- data/README.md +7 -4
- data/docs/Campaign.md +17 -0
- data/docs/ConversationCreateEventAllOfPayload.md +2 -2
- data/docs/ConversationPostbackEventAllOfPayload.md +1 -1
- data/docs/ConversationReferralEventAllOfPayload.md +1 -1
- data/docs/Reply.md +1 -1
- data/docs/SourceWithCampaignWebhook.md +29 -0
- data/docs/SourceWithCampaignWebhookAllOf.md +17 -0
- data/lib/sunshine-conversations-client/models/campaign.rb +205 -0
- data/lib/sunshine-conversations-client/models/conversation_create_event_all_of_payload.rb +4 -4
- data/lib/sunshine-conversations-client/models/conversation_postback_event_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_referral_event_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/reply.rb +1 -1
- data/lib/sunshine-conversations-client/models/source_with_campaign_webhook.rb +276 -0
- data/lib/sunshine-conversations-client/models/source_with_campaign_webhook_all_of.rb +204 -0
- data/lib/sunshine-conversations-client/version.rb +1 -1
- data/lib/sunshine-conversations-client.rb +3 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cb0ebcda41a5659e4a3dc8b68724deea5548fc8
|
4
|
+
data.tar.gz: bd4ce4079e45358d2b59573c622a008b52c9b93c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 431ea779fb02dec1c48de55ca54c5a0de3a7c829c497f66d39956c5545915f1e3d96386b63b8e0997b751b83fdd2ed0a03827f4884e9ad6a37278342ca50a1bf
|
7
|
+
data.tar.gz: ea095ebfd0810596e3859703e68614c7cb6fd2d7192e2f0815ac97c5a653d1f14564e419c3e2f26f4b47793d168761e36d537c9db66189a03f540fab0dbc126c
|
data/CHANGELOG_RB.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [9.13.0] - 2023-03-30
|
4
|
+
|
5
|
+
### Added
|
6
|
+
|
7
|
+
- Added a new `proactiveMessaging` creation reason for the `conversation:create` webhook event.
|
8
|
+
- Added a `campaign` object to the `source` object of the following webhook events:
|
9
|
+
- `conversation:create`
|
10
|
+
- `conversation:message`
|
11
|
+
- `conversation:postback`
|
12
|
+
- `conversation:referral`
|
13
|
+
|
3
14
|
## [9.12.0] - 2022-08-30
|
4
15
|
|
5
16
|
- The Switchboard `passControl` action is now idempotent if either the target `switchboardIntegration` is specified explicitly by its `id` or `name`, or the `next` keyword is used for the `switchboardIntegration` field, and the invoking integration can be identified by its [OAuth token](https://docs.smooch.io/guide/oauth/#redirect-and-acquiring-an-oauth-token) or [Custom Integration API Key](https://docs.smooch.io/rest/#tag/CustomIntegrationApiKeys) credentials. Duplicate passControl actions using the `next` keyword and their metadata are disregarded.
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@ SunshineConversationsClient - the Ruby gem for the Sunshine Conversations API
|
|
5
5
|
This SDK is automatically generated by the [OpenAPI Generator Codegen](https://github.com/OpenAPITools/openapi-generator) project using the [Sunshine Conversations API spec](https://github.com/zendesk/sunshine-conversations-api-spec).
|
6
6
|
|
7
7
|
- API version: 9.12.0
|
8
|
-
- Package version: 9.
|
8
|
+
- Package version: 9.13.0
|
9
9
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
10
10
|
|
11
11
|
## Sunshine Conversations API Version
|
@@ -32,16 +32,16 @@ gem build sunshine-conversations-client.gemspec
|
|
32
32
|
Then either install the gem locally:
|
33
33
|
|
34
34
|
```shell
|
35
|
-
gem install ./sunshine-conversations-client-9.
|
35
|
+
gem install ./sunshine-conversations-client-9.13.0.gem
|
36
36
|
```
|
37
37
|
|
38
|
-
(for development, run `gem install --dev ./sunshine-conversations-client-9.
|
38
|
+
(for development, run `gem install --dev ./sunshine-conversations-client-9.13.0.gem` to install the development dependencies)
|
39
39
|
|
40
40
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
41
41
|
|
42
42
|
Finally add this to the Gemfile:
|
43
43
|
|
44
|
-
gem 'sunshine-conversations-client', '~> 9.
|
44
|
+
gem 'sunshine-conversations-client', '~> 9.13.0'
|
45
45
|
|
46
46
|
### Install from Git
|
47
47
|
|
@@ -235,6 +235,7 @@ Class | Method | HTTP request | Description
|
|
235
235
|
- [SunshineConversationsClient::Author](docs/Author.md)
|
236
236
|
- [SunshineConversationsClient::AuthorWebhook](docs/AuthorWebhook.md)
|
237
237
|
- [SunshineConversationsClient::Buy](docs/Buy.md)
|
238
|
+
- [SunshineConversationsClient::Campaign](docs/Campaign.md)
|
238
239
|
- [SunshineConversationsClient::CarouselMessage](docs/CarouselMessage.md)
|
239
240
|
- [SunshineConversationsClient::CarouselMessageDisplaySettings](docs/CarouselMessageDisplaySettings.md)
|
240
241
|
- [SunshineConversationsClient::Client](docs/Client.md)
|
@@ -401,6 +402,8 @@ Class | Method | HTTP request | Description
|
|
401
402
|
- [SunshineConversationsClient::Reply](docs/Reply.md)
|
402
403
|
- [SunshineConversationsClient::Source](docs/Source.md)
|
403
404
|
- [SunshineConversationsClient::SourceWebhook](docs/SourceWebhook.md)
|
405
|
+
- [SunshineConversationsClient::SourceWithCampaignWebhook](docs/SourceWithCampaignWebhook.md)
|
406
|
+
- [SunshineConversationsClient::SourceWithCampaignWebhookAllOf](docs/SourceWithCampaignWebhookAllOf.md)
|
404
407
|
- [SunshineConversationsClient::Status](docs/Status.md)
|
405
408
|
- [SunshineConversationsClient::Switchboard](docs/Switchboard.md)
|
406
409
|
- [SunshineConversationsClient::SwitchboardAcceptControl](docs/SwitchboardAcceptControl.md)
|
data/docs/Campaign.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# SunshineConversationsClient::Campaign
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**id** | **String** | The unique ID of the campaign. | [optional]
|
8
|
+
|
9
|
+
## Code Sample
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'SunshineConversationsClient'
|
13
|
+
|
14
|
+
instance = SunshineConversationsClient::Campaign.new(id: de13bee15b51033b34162411)
|
15
|
+
```
|
16
|
+
|
17
|
+
|
@@ -5,8 +5,8 @@
|
|
5
5
|
Name | Type | Description | Notes
|
6
6
|
------------ | ------------- | ------------- | -------------
|
7
7
|
**conversation** | [**ConversationTruncated**](ConversationTruncated.md) | The conversation that was created. | [optional]
|
8
|
-
**creation_reason** | **String** | The reason why the conversation was created, if applicable. * `linkRequest` - The conversation was created in order to generate a link request to transfer the user to a different channel. * `message` - The conversation was created because a message was sent. * `none` - The conversation was not created for a specific purpose. Used primarily when a conversation is created via the Create Conversation API. * `notification` - The conversation was created by a call to the Notification API. * `prechatCapture` - The conversation was created because the user completed a prechat capture form in the Web Messenger. * `startConversation` - The conversation was created because of a call to the startConversation API on one of the SDK integrations, or a start conversation event was triggered from a messaging channel. | [optional]
|
9
|
-
**source** | [**
|
8
|
+
**creation_reason** | **String** | The reason why the conversation was created, if applicable. * `linkRequest` - The conversation was created in order to generate a link request to transfer the user to a different channel. * `message` - The conversation was created because a message was sent. * `none` - The conversation was not created for a specific purpose. Used primarily when a conversation is created via the Create Conversation API. * `notification` - The conversation was created by a call to the Notification API. * `prechatCapture` - The conversation was created because the user completed a prechat capture form in the Web Messenger. * `startConversation` - The conversation was created because of a call to the startConversation API on one of the SDK integrations, or a start conversation event was triggered from a messaging channel. * `proactiveMessaging` - The conversation was created because the user interacted with a campaign. | [optional]
|
9
|
+
**source** | [**SourceWithCampaignWebhook**](SourceWithCampaignWebhook.md) | The source of the creation. | [optional]
|
10
10
|
**user** | [**User**](User.md) | The user associated with the conversation. Only present if the created conversation was of type personal. For sdkGroup conversations, the list of participants can be fetched using the List Participants API, if required. | [optional]
|
11
11
|
**referral** | [**Referral**](Referral.md) | Referral information, if applicable. | [optional]
|
12
12
|
|
@@ -7,7 +7,7 @@ Name | Type | Description | Notes
|
|
7
7
|
**postback** | [**PostbackWebhook**](PostbackWebhook.md) | The postback associated with the event. | [optional]
|
8
8
|
**conversation** | [**ConversationTruncated**](ConversationTruncated.md) | The conversation linked to the postback. | [optional]
|
9
9
|
**user** | [**User**](User.md) | The user that triggered the postback. | [optional]
|
10
|
-
**source** | [**
|
10
|
+
**source** | [**SourceWithCampaignWebhook**](SourceWithCampaignWebhook.md) | The source of the postback. | [optional]
|
11
11
|
|
12
12
|
## Code Sample
|
13
13
|
|
@@ -6,7 +6,7 @@ Name | Type | Description | Notes
|
|
6
6
|
------------ | ------------- | ------------- | -------------
|
7
7
|
**conversation** | [**ConversationTruncated**](ConversationTruncated.md) | The conversation a user lands in after being referred. See the <a href=\"https://docs.smooch.io/guide/conversation-referrals/\">conversation referrals</a> guide for more details. | [optional]
|
8
8
|
**user** | [**User**](User.md) | The user associated with the conversation. | [optional]
|
9
|
-
**source** | [**
|
9
|
+
**source** | [**SourceWithCampaignWebhook**](SourceWithCampaignWebhook.md) | The source of the referral. | [optional]
|
10
10
|
**referral** | [**Referral**](Referral.md) | | [optional]
|
11
11
|
|
12
12
|
## Code Sample
|
data/docs/Reply.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
Name | Type | Description | Notes
|
6
6
|
------------ | ------------- | ------------- | -------------
|
7
7
|
**type** | **String** | The type of action. |
|
8
|
-
**text** | **String** | The button text. Text longer than 20 characters will be truncated on Facebook Messenger, and longer than 40 characters will be truncated on Web Messenger, iOS, and Android. |
|
8
|
+
**text** | **String** | The button text. We recommend a non-empty value because some channels may not support empty ones. Text longer than 20 characters will be truncated on Facebook Messenger, and longer than 40 characters will be truncated on Web Messenger, iOS, and Android. |
|
9
9
|
**payload** | **String** | A string payload to help you identify the action context. Used when posting the reply. You can also use metadata for more complex needs. |
|
10
10
|
**metadata** | [**Object**](.md) | Flat object containing custom properties. Strings, numbers and booleans are the only supported format that can be passed to metadata. The metadata is limited to 4KB in size. | [optional]
|
11
11
|
**icon_url** | **String** | An icon to render next to the reply option. | [optional]
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# SunshineConversationsClient::SourceWithCampaignWebhook
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**type** | **String** | An identifier for the channel from which a message originated. May include one of api, sdk, messenger, or any number of other channels. | [optional]
|
8
|
+
**integration_id** | **String** | Identifier indicating which integration the message was sent from. For user messages only. | [optional]
|
9
|
+
**original_message_id** | **String** | Message identifier assigned by the originating channel. | [optional]
|
10
|
+
**original_message_timestamp** | **String** | A datetime string with the format YYYY-MM-DDThh:mm:ss.SSSZ representing when the third-party channel received the message. | [optional]
|
11
|
+
**client** | [**Client**](Client.md) | The client from which the user authored the message or activity, if applicable. This field will only be present if the `includeFullSource` option is enabled for the webhook. | [optional]
|
12
|
+
**device** | [**Device**](Device.md) | The device from which the user authored the message or activity, if applicable. This field will only be present if the `includeFullSource` option is enabled for the webhook | [optional]
|
13
|
+
**campaign** | [**Campaign**](Campaign.md) | | [optional]
|
14
|
+
|
15
|
+
## Code Sample
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
require 'SunshineConversationsClient'
|
19
|
+
|
20
|
+
instance = SunshineConversationsClient::SourceWithCampaignWebhook.new(type: ios,
|
21
|
+
integration_id: null,
|
22
|
+
original_message_id: null,
|
23
|
+
original_message_timestamp: null,
|
24
|
+
client: null,
|
25
|
+
device: null,
|
26
|
+
campaign: null)
|
27
|
+
```
|
28
|
+
|
29
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# SunshineConversationsClient::SourceWithCampaignWebhookAllOf
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**campaign** | [**Campaign**](Campaign.md) | | [optional]
|
8
|
+
|
9
|
+
## Code Sample
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'SunshineConversationsClient'
|
13
|
+
|
14
|
+
instance = SunshineConversationsClient::SourceWithCampaignWebhookAllOf.new(campaign: null)
|
15
|
+
```
|
16
|
+
|
17
|
+
|
@@ -0,0 +1,205 @@
|
|
1
|
+
=begin
|
2
|
+
#Sunshine Conversations API
|
3
|
+
|
4
|
+
The version of the OpenAPI document: 9.12.0
|
5
|
+
|
6
|
+
Generated by: https://openapi-generator.tech
|
7
|
+
OpenAPI Generator version: 4.3.1
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'date'
|
11
|
+
|
12
|
+
module SunshineConversationsClient
|
13
|
+
# The campaign the user interacted with (if applicable).
|
14
|
+
class Campaign
|
15
|
+
# The unique ID of the campaign.
|
16
|
+
attr_accessor :id
|
17
|
+
|
18
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
19
|
+
def self.attribute_map
|
20
|
+
{
|
21
|
+
:'id' => :'id'
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
# Attribute type mapping.
|
26
|
+
def self.openapi_types
|
27
|
+
{
|
28
|
+
:'id' => :'String'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# List of attributes with nullable: true
|
33
|
+
def self.openapi_nullable
|
34
|
+
Set.new([
|
35
|
+
])
|
36
|
+
end
|
37
|
+
|
38
|
+
# Initializes the object
|
39
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
40
|
+
def initialize(attributes = {})
|
41
|
+
if (!attributes.is_a?(Hash))
|
42
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SunshineConversationsClient::Campaign` initialize method"
|
43
|
+
end
|
44
|
+
|
45
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
46
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
47
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
48
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SunshineConversationsClient::Campaign`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
49
|
+
end
|
50
|
+
h[k.to_sym] = v
|
51
|
+
}
|
52
|
+
|
53
|
+
if attributes.key?(:'id')
|
54
|
+
self.id = attributes[:'id']
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
59
|
+
# @return Array for valid properties with the reasons
|
60
|
+
def list_invalid_properties
|
61
|
+
invalid_properties = Array.new
|
62
|
+
invalid_properties
|
63
|
+
end
|
64
|
+
|
65
|
+
# Check to see if the all the properties in the model are valid
|
66
|
+
# @return true if the model is valid
|
67
|
+
def valid?
|
68
|
+
true
|
69
|
+
end
|
70
|
+
|
71
|
+
# Checks equality by comparing each attribute.
|
72
|
+
# @param [Object] Object to be compared
|
73
|
+
def ==(o)
|
74
|
+
return true if self.equal?(o)
|
75
|
+
self.class == o.class &&
|
76
|
+
id == o.id
|
77
|
+
end
|
78
|
+
|
79
|
+
# @see the `==` method
|
80
|
+
# @param [Object] Object to be compared
|
81
|
+
def eql?(o)
|
82
|
+
self == o
|
83
|
+
end
|
84
|
+
|
85
|
+
# Calculates hash code according to all attributes.
|
86
|
+
# @return [Integer] Hash code
|
87
|
+
def hash
|
88
|
+
[id].hash
|
89
|
+
end
|
90
|
+
|
91
|
+
# Builds the object from hash
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
93
|
+
# @return [Object] Returns the model itself
|
94
|
+
def self.build_from_hash(attributes)
|
95
|
+
new.build_from_hash(attributes)
|
96
|
+
end
|
97
|
+
|
98
|
+
# Builds the object from hash
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
100
|
+
# @return [Object] Returns the model itself
|
101
|
+
def build_from_hash(attributes)
|
102
|
+
return nil unless attributes.is_a?(Hash)
|
103
|
+
self.class.openapi_types.each_pair do |key, type|
|
104
|
+
if type =~ /\AArray<(.*)>/i
|
105
|
+
# check to ensure the input is an array given that the attribute
|
106
|
+
# is documented as an array but the input is not
|
107
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
108
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
109
|
+
end
|
110
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
111
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
112
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
113
|
+
end
|
114
|
+
|
115
|
+
self
|
116
|
+
end
|
117
|
+
|
118
|
+
# Deserializes the data based on type
|
119
|
+
# @param string type Data type
|
120
|
+
# @param string value Value to be deserialized
|
121
|
+
# @return [Object] Deserialized data
|
122
|
+
def _deserialize(type, value)
|
123
|
+
case type.to_sym
|
124
|
+
when :DateTime
|
125
|
+
DateTime.parse(value)
|
126
|
+
when :Date
|
127
|
+
Date.parse(value)
|
128
|
+
when :String
|
129
|
+
value.to_s
|
130
|
+
when :Integer
|
131
|
+
value.to_i
|
132
|
+
when :Float
|
133
|
+
value.to_f
|
134
|
+
when :Boolean
|
135
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
136
|
+
true
|
137
|
+
else
|
138
|
+
false
|
139
|
+
end
|
140
|
+
when :Object
|
141
|
+
# generic object (usually a Hash), return directly
|
142
|
+
value
|
143
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
144
|
+
inner_type = Regexp.last_match[:inner_type]
|
145
|
+
value.map { |v| _deserialize(inner_type, v) }
|
146
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
147
|
+
k_type = Regexp.last_match[:k_type]
|
148
|
+
v_type = Regexp.last_match[:v_type]
|
149
|
+
{}.tap do |hash|
|
150
|
+
value.each do |k, v|
|
151
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
else # model
|
155
|
+
SunshineConversationsClient.const_get(type).build_from_hash(value)
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
# Returns the string representation of the object
|
160
|
+
# @return [String] String presentation of the object
|
161
|
+
def to_s
|
162
|
+
to_hash.to_s
|
163
|
+
end
|
164
|
+
|
165
|
+
# to_body is an alias to to_hash (backward compatibility)
|
166
|
+
# @return [Hash] Returns the object in the form of hash
|
167
|
+
def to_body
|
168
|
+
to_hash
|
169
|
+
end
|
170
|
+
|
171
|
+
# Returns the object in the form of hash
|
172
|
+
# @return [Hash] Returns the object in the form of hash
|
173
|
+
def to_hash
|
174
|
+
hash = {}
|
175
|
+
self.class.attribute_map.each_pair do |attr, param|
|
176
|
+
value = self.send(attr)
|
177
|
+
if value.nil?
|
178
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
179
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
180
|
+
end
|
181
|
+
|
182
|
+
hash[param] = _to_hash(value)
|
183
|
+
end
|
184
|
+
hash
|
185
|
+
end
|
186
|
+
|
187
|
+
# Outputs non-array value in the form of hash
|
188
|
+
# For object, use to_hash. Otherwise, just return the value
|
189
|
+
# @param [Object] value Any valid value
|
190
|
+
# @return [Hash] Returns the value in the form of hash
|
191
|
+
def _to_hash(value)
|
192
|
+
if value.is_a?(Array)
|
193
|
+
value.compact.map { |v| _to_hash(v) }
|
194
|
+
elsif value.is_a?(Hash)
|
195
|
+
{}.tap do |hash|
|
196
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
197
|
+
end
|
198
|
+
elsif value.respond_to? :to_hash
|
199
|
+
value.to_hash
|
200
|
+
else
|
201
|
+
value
|
202
|
+
end
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
@@ -15,7 +15,7 @@ module SunshineConversationsClient
|
|
15
15
|
# The conversation that was created.
|
16
16
|
attr_accessor :conversation
|
17
17
|
|
18
|
-
# The reason why the conversation was created, if applicable. * `linkRequest` - The conversation was created in order to generate a link request to transfer the user to a different channel. * `message` - The conversation was created because a message was sent. * `none` - The conversation was not created for a specific purpose. Used primarily when a conversation is created via the Create Conversation API. * `notification` - The conversation was created by a call to the Notification API. * `prechatCapture` - The conversation was created because the user completed a prechat capture form in the Web Messenger. * `startConversation` - The conversation was created because of a call to the startConversation API on one of the SDK integrations, or a start conversation event was triggered from a messaging channel.
|
18
|
+
# The reason why the conversation was created, if applicable. * `linkRequest` - The conversation was created in order to generate a link request to transfer the user to a different channel. * `message` - The conversation was created because a message was sent. * `none` - The conversation was not created for a specific purpose. Used primarily when a conversation is created via the Create Conversation API. * `notification` - The conversation was created by a call to the Notification API. * `prechatCapture` - The conversation was created because the user completed a prechat capture form in the Web Messenger. * `startConversation` - The conversation was created because of a call to the startConversation API on one of the SDK integrations, or a start conversation event was triggered from a messaging channel. * `proactiveMessaging` - The conversation was created because the user interacted with a campaign.
|
19
19
|
attr_accessor :creation_reason
|
20
20
|
|
21
21
|
# The source of the creation.
|
@@ -65,7 +65,7 @@ module SunshineConversationsClient
|
|
65
65
|
{
|
66
66
|
:'conversation' => :'ConversationTruncated',
|
67
67
|
:'creation_reason' => :'String',
|
68
|
-
:'source' => :'
|
68
|
+
:'source' => :'SourceWithCampaignWebhook',
|
69
69
|
:'user' => :'User',
|
70
70
|
:'referral' => :'Referral'
|
71
71
|
}
|
@@ -125,7 +125,7 @@ module SunshineConversationsClient
|
|
125
125
|
# Check to see if the all the properties in the model are valid
|
126
126
|
# @return true if the model is valid
|
127
127
|
def valid?
|
128
|
-
creation_reason_validator = EnumAttributeValidator.new('String', ["linkRequest", "message", "none", "notification", "prechatCapture", "startConversation"])
|
128
|
+
creation_reason_validator = EnumAttributeValidator.new('String', ["linkRequest", "message", "none", "notification", "prechatCapture", "startConversation", "proactiveMessaging"])
|
129
129
|
return false unless creation_reason_validator.valid?(@creation_reason)
|
130
130
|
true
|
131
131
|
end
|
@@ -133,7 +133,7 @@ module SunshineConversationsClient
|
|
133
133
|
# Custom attribute writer method checking allowed values (enum).
|
134
134
|
# @param [Object] creation_reason Object to be assigned
|
135
135
|
def creation_reason=(creation_reason)
|
136
|
-
validator = EnumAttributeValidator.new('String', ["linkRequest", "message", "none", "notification", "prechatCapture", "startConversation"])
|
136
|
+
validator = EnumAttributeValidator.new('String', ["linkRequest", "message", "none", "notification", "prechatCapture", "startConversation", "proactiveMessaging"])
|
137
137
|
unless validator.valid?(creation_reason)
|
138
138
|
fail ArgumentError, "invalid value for \"creation_reason\", must be one of #{validator.allowable_values}."
|
139
139
|
end
|
@@ -14,7 +14,7 @@ module SunshineConversationsClient
|
|
14
14
|
# The type of action.
|
15
15
|
attr_accessor :type
|
16
16
|
|
17
|
-
# The button text. Text longer than 20 characters will be truncated on Facebook Messenger, and longer than 40 characters will be truncated on Web Messenger, iOS, and Android.
|
17
|
+
# The button text. We recommend a non-empty value because some channels may not support empty ones. Text longer than 20 characters will be truncated on Facebook Messenger, and longer than 40 characters will be truncated on Web Messenger, iOS, and Android.
|
18
18
|
attr_accessor :text
|
19
19
|
|
20
20
|
# A string payload to help you identify the action context. Used when posting the reply. You can also use metadata for more complex needs.
|
@@ -0,0 +1,276 @@
|
|
1
|
+
=begin
|
2
|
+
#Sunshine Conversations API
|
3
|
+
|
4
|
+
The version of the OpenAPI document: 9.12.0
|
5
|
+
|
6
|
+
Generated by: https://openapi-generator.tech
|
7
|
+
OpenAPI Generator version: 4.3.1
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'date'
|
11
|
+
|
12
|
+
module SunshineConversationsClient
|
13
|
+
class SourceWithCampaignWebhook
|
14
|
+
# An identifier for the channel from which a message originated. May include one of api, sdk, messenger, or any number of other channels.
|
15
|
+
attr_accessor :type
|
16
|
+
|
17
|
+
# Identifier indicating which integration the message was sent from. For user messages only.
|
18
|
+
attr_accessor :integration_id
|
19
|
+
|
20
|
+
# Message identifier assigned by the originating channel.
|
21
|
+
attr_accessor :original_message_id
|
22
|
+
|
23
|
+
# A datetime string with the format YYYY-MM-DDThh:mm:ss.SSSZ representing when the third-party channel received the message.
|
24
|
+
attr_accessor :original_message_timestamp
|
25
|
+
|
26
|
+
# The client from which the user authored the message or activity, if applicable. This field will only be present if the `includeFullSource` option is enabled for the webhook.
|
27
|
+
attr_accessor :client
|
28
|
+
|
29
|
+
# The device from which the user authored the message or activity, if applicable. This field will only be present if the `includeFullSource` option is enabled for the webhook
|
30
|
+
attr_accessor :device
|
31
|
+
|
32
|
+
attr_accessor :campaign
|
33
|
+
|
34
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
35
|
+
def self.attribute_map
|
36
|
+
{
|
37
|
+
:'type' => :'type',
|
38
|
+
:'integration_id' => :'integrationId',
|
39
|
+
:'original_message_id' => :'originalMessageId',
|
40
|
+
:'original_message_timestamp' => :'originalMessageTimestamp',
|
41
|
+
:'client' => :'client',
|
42
|
+
:'device' => :'device',
|
43
|
+
:'campaign' => :'campaign'
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# Attribute type mapping.
|
48
|
+
def self.openapi_types
|
49
|
+
{
|
50
|
+
:'type' => :'String',
|
51
|
+
:'integration_id' => :'String',
|
52
|
+
:'original_message_id' => :'String',
|
53
|
+
:'original_message_timestamp' => :'String',
|
54
|
+
:'client' => :'Client',
|
55
|
+
:'device' => :'Device',
|
56
|
+
:'campaign' => :'Campaign'
|
57
|
+
}
|
58
|
+
end
|
59
|
+
|
60
|
+
# List of attributes with nullable: true
|
61
|
+
def self.openapi_nullable
|
62
|
+
Set.new([
|
63
|
+
:'original_message_id',
|
64
|
+
:'original_message_timestamp',
|
65
|
+
:'client',
|
66
|
+
:'device',
|
67
|
+
:'campaign'
|
68
|
+
])
|
69
|
+
end
|
70
|
+
|
71
|
+
# List of class defined in allOf (OpenAPI v3)
|
72
|
+
def self.openapi_all_of
|
73
|
+
[
|
74
|
+
:'SourceWebhook',
|
75
|
+
:'SourceWithCampaignWebhookAllOf'
|
76
|
+
]
|
77
|
+
end
|
78
|
+
|
79
|
+
# Initializes the object
|
80
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
81
|
+
def initialize(attributes = {})
|
82
|
+
if (!attributes.is_a?(Hash))
|
83
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SunshineConversationsClient::SourceWithCampaignWebhook` initialize method"
|
84
|
+
end
|
85
|
+
|
86
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
87
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
88
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
89
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SunshineConversationsClient::SourceWithCampaignWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
90
|
+
end
|
91
|
+
h[k.to_sym] = v
|
92
|
+
}
|
93
|
+
|
94
|
+
if attributes.key?(:'type')
|
95
|
+
self.type = attributes[:'type']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:'integration_id')
|
99
|
+
self.integration_id = attributes[:'integration_id']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:'original_message_id')
|
103
|
+
self.original_message_id = attributes[:'original_message_id']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.key?(:'original_message_timestamp')
|
107
|
+
self.original_message_timestamp = attributes[:'original_message_timestamp']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.key?(:'client')
|
111
|
+
self.client = attributes[:'client']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.key?(:'device')
|
115
|
+
self.device = attributes[:'device']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'campaign')
|
119
|
+
self.campaign = attributes[:'campaign']
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
124
|
+
# @return Array for valid properties with the reasons
|
125
|
+
def list_invalid_properties
|
126
|
+
invalid_properties = Array.new
|
127
|
+
invalid_properties
|
128
|
+
end
|
129
|
+
|
130
|
+
# Check to see if the all the properties in the model are valid
|
131
|
+
# @return true if the model is valid
|
132
|
+
def valid?
|
133
|
+
true
|
134
|
+
end
|
135
|
+
|
136
|
+
# Checks equality by comparing each attribute.
|
137
|
+
# @param [Object] Object to be compared
|
138
|
+
def ==(o)
|
139
|
+
return true if self.equal?(o)
|
140
|
+
self.class == o.class &&
|
141
|
+
type == o.type &&
|
142
|
+
integration_id == o.integration_id &&
|
143
|
+
original_message_id == o.original_message_id &&
|
144
|
+
original_message_timestamp == o.original_message_timestamp &&
|
145
|
+
client == o.client &&
|
146
|
+
device == o.device &&
|
147
|
+
campaign == o.campaign
|
148
|
+
end
|
149
|
+
|
150
|
+
# @see the `==` method
|
151
|
+
# @param [Object] Object to be compared
|
152
|
+
def eql?(o)
|
153
|
+
self == o
|
154
|
+
end
|
155
|
+
|
156
|
+
# Calculates hash code according to all attributes.
|
157
|
+
# @return [Integer] Hash code
|
158
|
+
def hash
|
159
|
+
[type, integration_id, original_message_id, original_message_timestamp, client, device, campaign].hash
|
160
|
+
end
|
161
|
+
|
162
|
+
# Builds the object from hash
|
163
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
164
|
+
# @return [Object] Returns the model itself
|
165
|
+
def self.build_from_hash(attributes)
|
166
|
+
new.build_from_hash(attributes)
|
167
|
+
end
|
168
|
+
|
169
|
+
# Builds the object from hash
|
170
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
171
|
+
# @return [Object] Returns the model itself
|
172
|
+
def build_from_hash(attributes)
|
173
|
+
return nil unless attributes.is_a?(Hash)
|
174
|
+
self.class.openapi_types.each_pair do |key, type|
|
175
|
+
if type =~ /\AArray<(.*)>/i
|
176
|
+
# check to ensure the input is an array given that the attribute
|
177
|
+
# is documented as an array but the input is not
|
178
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
179
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
180
|
+
end
|
181
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
182
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
183
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
184
|
+
end
|
185
|
+
|
186
|
+
self
|
187
|
+
end
|
188
|
+
|
189
|
+
# Deserializes the data based on type
|
190
|
+
# @param string type Data type
|
191
|
+
# @param string value Value to be deserialized
|
192
|
+
# @return [Object] Deserialized data
|
193
|
+
def _deserialize(type, value)
|
194
|
+
case type.to_sym
|
195
|
+
when :DateTime
|
196
|
+
DateTime.parse(value)
|
197
|
+
when :Date
|
198
|
+
Date.parse(value)
|
199
|
+
when :String
|
200
|
+
value.to_s
|
201
|
+
when :Integer
|
202
|
+
value.to_i
|
203
|
+
when :Float
|
204
|
+
value.to_f
|
205
|
+
when :Boolean
|
206
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
207
|
+
true
|
208
|
+
else
|
209
|
+
false
|
210
|
+
end
|
211
|
+
when :Object
|
212
|
+
# generic object (usually a Hash), return directly
|
213
|
+
value
|
214
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
215
|
+
inner_type = Regexp.last_match[:inner_type]
|
216
|
+
value.map { |v| _deserialize(inner_type, v) }
|
217
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
218
|
+
k_type = Regexp.last_match[:k_type]
|
219
|
+
v_type = Regexp.last_match[:v_type]
|
220
|
+
{}.tap do |hash|
|
221
|
+
value.each do |k, v|
|
222
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
223
|
+
end
|
224
|
+
end
|
225
|
+
else # model
|
226
|
+
SunshineConversationsClient.const_get(type).build_from_hash(value)
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
# Returns the string representation of the object
|
231
|
+
# @return [String] String presentation of the object
|
232
|
+
def to_s
|
233
|
+
to_hash.to_s
|
234
|
+
end
|
235
|
+
|
236
|
+
# to_body is an alias to to_hash (backward compatibility)
|
237
|
+
# @return [Hash] Returns the object in the form of hash
|
238
|
+
def to_body
|
239
|
+
to_hash
|
240
|
+
end
|
241
|
+
|
242
|
+
# Returns the object in the form of hash
|
243
|
+
# @return [Hash] Returns the object in the form of hash
|
244
|
+
def to_hash
|
245
|
+
hash = {}
|
246
|
+
self.class.attribute_map.each_pair do |attr, param|
|
247
|
+
value = self.send(attr)
|
248
|
+
if value.nil?
|
249
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
250
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
251
|
+
end
|
252
|
+
|
253
|
+
hash[param] = _to_hash(value)
|
254
|
+
end
|
255
|
+
hash
|
256
|
+
end
|
257
|
+
|
258
|
+
# Outputs non-array value in the form of hash
|
259
|
+
# For object, use to_hash. Otherwise, just return the value
|
260
|
+
# @param [Object] value Any valid value
|
261
|
+
# @return [Hash] Returns the value in the form of hash
|
262
|
+
def _to_hash(value)
|
263
|
+
if value.is_a?(Array)
|
264
|
+
value.compact.map { |v| _to_hash(v) }
|
265
|
+
elsif value.is_a?(Hash)
|
266
|
+
{}.tap do |hash|
|
267
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
268
|
+
end
|
269
|
+
elsif value.respond_to? :to_hash
|
270
|
+
value.to_hash
|
271
|
+
else
|
272
|
+
value
|
273
|
+
end
|
274
|
+
end
|
275
|
+
end
|
276
|
+
end
|
@@ -0,0 +1,204 @@
|
|
1
|
+
=begin
|
2
|
+
#Sunshine Conversations API
|
3
|
+
|
4
|
+
The version of the OpenAPI document: 9.12.0
|
5
|
+
|
6
|
+
Generated by: https://openapi-generator.tech
|
7
|
+
OpenAPI Generator version: 4.3.1
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'date'
|
11
|
+
|
12
|
+
module SunshineConversationsClient
|
13
|
+
class SourceWithCampaignWebhookAllOf
|
14
|
+
attr_accessor :campaign
|
15
|
+
|
16
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:'campaign' => :'campaign'
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
# Attribute type mapping.
|
24
|
+
def self.openapi_types
|
25
|
+
{
|
26
|
+
:'campaign' => :'Campaign'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# List of attributes with nullable: true
|
31
|
+
def self.openapi_nullable
|
32
|
+
Set.new([
|
33
|
+
:'campaign'
|
34
|
+
])
|
35
|
+
end
|
36
|
+
|
37
|
+
# Initializes the object
|
38
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
39
|
+
def initialize(attributes = {})
|
40
|
+
if (!attributes.is_a?(Hash))
|
41
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SunshineConversationsClient::SourceWithCampaignWebhookAllOf` initialize method"
|
42
|
+
end
|
43
|
+
|
44
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
45
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
46
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
47
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SunshineConversationsClient::SourceWithCampaignWebhookAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
48
|
+
end
|
49
|
+
h[k.to_sym] = v
|
50
|
+
}
|
51
|
+
|
52
|
+
if attributes.key?(:'campaign')
|
53
|
+
self.campaign = attributes[:'campaign']
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
58
|
+
# @return Array for valid properties with the reasons
|
59
|
+
def list_invalid_properties
|
60
|
+
invalid_properties = Array.new
|
61
|
+
invalid_properties
|
62
|
+
end
|
63
|
+
|
64
|
+
# Check to see if the all the properties in the model are valid
|
65
|
+
# @return true if the model is valid
|
66
|
+
def valid?
|
67
|
+
true
|
68
|
+
end
|
69
|
+
|
70
|
+
# Checks equality by comparing each attribute.
|
71
|
+
# @param [Object] Object to be compared
|
72
|
+
def ==(o)
|
73
|
+
return true if self.equal?(o)
|
74
|
+
self.class == o.class &&
|
75
|
+
campaign == o.campaign
|
76
|
+
end
|
77
|
+
|
78
|
+
# @see the `==` method
|
79
|
+
# @param [Object] Object to be compared
|
80
|
+
def eql?(o)
|
81
|
+
self == o
|
82
|
+
end
|
83
|
+
|
84
|
+
# Calculates hash code according to all attributes.
|
85
|
+
# @return [Integer] Hash code
|
86
|
+
def hash
|
87
|
+
[campaign].hash
|
88
|
+
end
|
89
|
+
|
90
|
+
# Builds the object from hash
|
91
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
92
|
+
# @return [Object] Returns the model itself
|
93
|
+
def self.build_from_hash(attributes)
|
94
|
+
new.build_from_hash(attributes)
|
95
|
+
end
|
96
|
+
|
97
|
+
# Builds the object from hash
|
98
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
99
|
+
# @return [Object] Returns the model itself
|
100
|
+
def build_from_hash(attributes)
|
101
|
+
return nil unless attributes.is_a?(Hash)
|
102
|
+
self.class.openapi_types.each_pair do |key, type|
|
103
|
+
if type =~ /\AArray<(.*)>/i
|
104
|
+
# check to ensure the input is an array given that the attribute
|
105
|
+
# is documented as an array but the input is not
|
106
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
107
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
108
|
+
end
|
109
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
110
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
111
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
112
|
+
end
|
113
|
+
|
114
|
+
self
|
115
|
+
end
|
116
|
+
|
117
|
+
# Deserializes the data based on type
|
118
|
+
# @param string type Data type
|
119
|
+
# @param string value Value to be deserialized
|
120
|
+
# @return [Object] Deserialized data
|
121
|
+
def _deserialize(type, value)
|
122
|
+
case type.to_sym
|
123
|
+
when :DateTime
|
124
|
+
DateTime.parse(value)
|
125
|
+
when :Date
|
126
|
+
Date.parse(value)
|
127
|
+
when :String
|
128
|
+
value.to_s
|
129
|
+
when :Integer
|
130
|
+
value.to_i
|
131
|
+
when :Float
|
132
|
+
value.to_f
|
133
|
+
when :Boolean
|
134
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
135
|
+
true
|
136
|
+
else
|
137
|
+
false
|
138
|
+
end
|
139
|
+
when :Object
|
140
|
+
# generic object (usually a Hash), return directly
|
141
|
+
value
|
142
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
143
|
+
inner_type = Regexp.last_match[:inner_type]
|
144
|
+
value.map { |v| _deserialize(inner_type, v) }
|
145
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
146
|
+
k_type = Regexp.last_match[:k_type]
|
147
|
+
v_type = Regexp.last_match[:v_type]
|
148
|
+
{}.tap do |hash|
|
149
|
+
value.each do |k, v|
|
150
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
else # model
|
154
|
+
SunshineConversationsClient.const_get(type).build_from_hash(value)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
# Returns the string representation of the object
|
159
|
+
# @return [String] String presentation of the object
|
160
|
+
def to_s
|
161
|
+
to_hash.to_s
|
162
|
+
end
|
163
|
+
|
164
|
+
# to_body is an alias to to_hash (backward compatibility)
|
165
|
+
# @return [Hash] Returns the object in the form of hash
|
166
|
+
def to_body
|
167
|
+
to_hash
|
168
|
+
end
|
169
|
+
|
170
|
+
# Returns the object in the form of hash
|
171
|
+
# @return [Hash] Returns the object in the form of hash
|
172
|
+
def to_hash
|
173
|
+
hash = {}
|
174
|
+
self.class.attribute_map.each_pair do |attr, param|
|
175
|
+
value = self.send(attr)
|
176
|
+
if value.nil?
|
177
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
178
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
179
|
+
end
|
180
|
+
|
181
|
+
hash[param] = _to_hash(value)
|
182
|
+
end
|
183
|
+
hash
|
184
|
+
end
|
185
|
+
|
186
|
+
# Outputs non-array value in the form of hash
|
187
|
+
# For object, use to_hash. Otherwise, just return the value
|
188
|
+
# @param [Object] value Any valid value
|
189
|
+
# @return [Hash] Returns the value in the form of hash
|
190
|
+
def _to_hash(value)
|
191
|
+
if value.is_a?(Array)
|
192
|
+
value.compact.map { |v| _to_hash(v) }
|
193
|
+
elsif value.is_a?(Hash)
|
194
|
+
{}.tap do |hash|
|
195
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
196
|
+
end
|
197
|
+
elsif value.respond_to? :to_hash
|
198
|
+
value.to_hash
|
199
|
+
else
|
200
|
+
value
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
204
|
+
end
|
@@ -61,6 +61,7 @@ require 'sunshine-conversations-client/models/attachment_upload_body'
|
|
61
61
|
require 'sunshine-conversations-client/models/author'
|
62
62
|
require 'sunshine-conversations-client/models/author_webhook'
|
63
63
|
require 'sunshine-conversations-client/models/buy'
|
64
|
+
require 'sunshine-conversations-client/models/campaign'
|
64
65
|
require 'sunshine-conversations-client/models/carousel_message'
|
65
66
|
require 'sunshine-conversations-client/models/carousel_message_display_settings'
|
66
67
|
require 'sunshine-conversations-client/models/client'
|
@@ -227,6 +228,8 @@ require 'sunshine-conversations-client/models/referral_details'
|
|
227
228
|
require 'sunshine-conversations-client/models/reply'
|
228
229
|
require 'sunshine-conversations-client/models/source'
|
229
230
|
require 'sunshine-conversations-client/models/source_webhook'
|
231
|
+
require 'sunshine-conversations-client/models/source_with_campaign_webhook'
|
232
|
+
require 'sunshine-conversations-client/models/source_with_campaign_webhook_all_of'
|
230
233
|
require 'sunshine-conversations-client/models/status'
|
231
234
|
require 'sunshine-conversations-client/models/switchboard'
|
232
235
|
require 'sunshine-conversations-client/models/switchboard_accept_control'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sunshine-conversations-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.
|
4
|
+
version: 9.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sunshine Conversations
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -123,6 +123,7 @@ files:
|
|
123
123
|
- docs/Author.md
|
124
124
|
- docs/AuthorWebhook.md
|
125
125
|
- docs/Buy.md
|
126
|
+
- docs/Campaign.md
|
126
127
|
- docs/CarouselMessage.md
|
127
128
|
- docs/CarouselMessageDisplaySettings.md
|
128
129
|
- docs/Client.md
|
@@ -296,6 +297,8 @@ files:
|
|
296
297
|
- docs/Reply.md
|
297
298
|
- docs/Source.md
|
298
299
|
- docs/SourceWebhook.md
|
300
|
+
- docs/SourceWithCampaignWebhook.md
|
301
|
+
- docs/SourceWithCampaignWebhookAllOf.md
|
299
302
|
- docs/Status.md
|
300
303
|
- docs/Switchboard.md
|
301
304
|
- docs/SwitchboardAcceptControl.md
|
@@ -428,6 +431,7 @@ files:
|
|
428
431
|
- lib/sunshine-conversations-client/models/author.rb
|
429
432
|
- lib/sunshine-conversations-client/models/author_webhook.rb
|
430
433
|
- lib/sunshine-conversations-client/models/buy.rb
|
434
|
+
- lib/sunshine-conversations-client/models/campaign.rb
|
431
435
|
- lib/sunshine-conversations-client/models/carousel_message.rb
|
432
436
|
- lib/sunshine-conversations-client/models/carousel_message_display_settings.rb
|
433
437
|
- lib/sunshine-conversations-client/models/client.rb
|
@@ -594,6 +598,8 @@ files:
|
|
594
598
|
- lib/sunshine-conversations-client/models/reply.rb
|
595
599
|
- lib/sunshine-conversations-client/models/source.rb
|
596
600
|
- lib/sunshine-conversations-client/models/source_webhook.rb
|
601
|
+
- lib/sunshine-conversations-client/models/source_with_campaign_webhook.rb
|
602
|
+
- lib/sunshine-conversations-client/models/source_with_campaign_webhook_all_of.rb
|
597
603
|
- lib/sunshine-conversations-client/models/status.rb
|
598
604
|
- lib/sunshine-conversations-client/models/switchboard.rb
|
599
605
|
- lib/sunshine-conversations-client/models/switchboard_accept_control.rb
|