getstream-ruby 6.1.0 → 7.0.0
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.
- checksums.yaml +4 -4
- data/README.md +22 -6
- data/lib/getstream_ruby/client.rb +63 -5
- data/lib/getstream_ruby/configuration.rb +32 -5
- data/lib/getstream_ruby/generated/common_client.rb +26 -0
- data/lib/getstream_ruby/generated/feed.rb +3 -1
- data/lib/getstream_ruby/generated/feeds_client.rb +3 -1
- data/lib/getstream_ruby/generated/models/add_activity_request.rb +5 -0
- data/lib/getstream_ruby/generated/models/add_reaction_request.rb +5 -0
- data/lib/getstream_ruby/generated/models/bodyguard_profile_summary.rb +6 -1
- data/lib/getstream_ruby/generated/models/chat_draft_payload_response.rb +91 -0
- data/lib/getstream_ruby/generated/models/chat_draft_response.rb +56 -0
- data/lib/getstream_ruby/generated/models/chat_message_response.rb +59 -4
- data/lib/getstream_ruby/generated/models/chat_moderation_v2_response.rb +66 -0
- data/lib/getstream_ruby/generated/models/chat_reaction_group_response.rb +51 -0
- data/lib/getstream_ruby/generated/models/chat_reaction_group_user_response.rb +41 -0
- data/lib/getstream_ruby/generated/models/chat_reaction_response.rb +66 -0
- data/lib/getstream_ruby/generated/models/chat_reminder_response_data.rb +66 -0
- data/lib/getstream_ruby/generated/models/chat_shared_location_response_data.rb +76 -0
- data/lib/getstream_ruby/generated/models/delete_feeds_batch_request.rb +6 -1
- data/lib/getstream_ruby/generated/models/feeds_activity_location.rb +36 -0
- data/lib/getstream_ruby/generated/models/feeds_bookmark_response.rb +61 -0
- data/lib/getstream_ruby/generated/models/feeds_enriched_collection_response.rb +61 -0
- data/lib/getstream_ruby/generated/models/feeds_feed_response.rb +116 -0
- data/lib/getstream_ruby/generated/models/feeds_notification_comment.rb +46 -0
- data/lib/getstream_ruby/generated/models/feeds_notification_context.rb +36 -0
- data/lib/getstream_ruby/generated/models/feeds_notification_parent_activity.rb +51 -0
- data/lib/getstream_ruby/generated/models/feeds_notification_target.rb +71 -0
- data/lib/getstream_ruby/generated/models/feeds_notification_trigger.rb +46 -0
- data/lib/getstream_ruby/generated/models/feeds_reaction_group_response.rb +3 -3
- data/lib/getstream_ruby/generated/models/feeds_reaction_response.rb +6 -6
- data/lib/getstream_ruby/generated/models/feeds_v3_activity_response.rb +66 -6
- data/lib/getstream_ruby/generated/models/feeds_v3_comment_response.rb +17 -2
- data/lib/getstream_ruby/generated/models/labels_request.rb +5 -0
- data/lib/getstream_ruby/generated/models/query_bookmarks_request.rb +11 -1
- data/lib/getstream_ruby/generated/models/search_roles_response.rb +36 -0
- data/lib/getstream_ruby/generated/models/submit_moderation_feedback_request.rb +71 -0
- data/lib/getstream_ruby/generated/models/submit_moderation_feedback_response.rb +31 -0
- data/lib/getstream_ruby/generated/models/update_app_request.rb +5 -0
- data/lib/getstream_ruby/generated/models/upsert_activities_request.rb +5 -0
- data/lib/getstream_ruby/generated/moderation_client.rb +17 -0
- data/lib/getstream_ruby/generated/webhook.rb +401 -170
- data/lib/getstream_ruby/version.rb +1 -1
- data/lib/getstream_ruby.rb +2 -3
- metadata +22 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 725fbf9f73fef4a9c33f241c9911d226222041e245084e2dbca69cbc0418eaef
|
|
4
|
+
data.tar.gz: 637cc6dd6bc256959b15ae6a98e62f1131f3bfdf6183e8c3f64acd6e6cfc33d2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 21e076ab8023229dbdda7feff3405716929d315aa96c0d0478df09c3f7b27db8a6d24e9ea399782e16cc52f355807e33adcebe558e2c040acfcb66875b8d9ed8
|
|
7
|
+
data.tar.gz: 96f2ce649e6c7f40e1651696f39c7e3612ea822e93351c3a86f0ce352b854f7a4ac12e7216f95df9933754da6a107dcb2ac6aa85892c9bc453f437c5cbf252a3
|
data/README.md
CHANGED
|
@@ -36,9 +36,23 @@ require 'getstream_ruby'
|
|
|
36
36
|
client = GetStreamRuby.manual(
|
|
37
37
|
api_key: "your_api_key",
|
|
38
38
|
api_secret: "your_api_secret",
|
|
39
|
+
# Optional HTTP tuning for keep-alive / connection reuse
|
|
40
|
+
connection_keep_alive: true,
|
|
41
|
+
# Optional: bring your own Faraday adapter (default is Faraday.default_adapter)
|
|
42
|
+
faraday_adapter: :net_http,
|
|
43
|
+
faraday_adapter_options: {
|
|
44
|
+
# adapter-specific options
|
|
45
|
+
}
|
|
39
46
|
)
|
|
40
47
|
```
|
|
41
48
|
|
|
49
|
+
You can also set these via environment variables:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
STREAM_CONNECTION_KEEP_ALIVE=true
|
|
53
|
+
STREAM_FARADAY_ADAPTER=net_http
|
|
54
|
+
```
|
|
55
|
+
|
|
42
56
|
### Method 2: .env File
|
|
43
57
|
|
|
44
58
|
Create a `.env` file in your project root:
|
|
@@ -336,18 +350,20 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/getstr
|
|
|
336
350
|
|
|
337
351
|
## Release Process
|
|
338
352
|
|
|
339
|
-
Releases use two paths
|
|
353
|
+
Releases use two paths, both handled by `.github/workflows/release.yml`:
|
|
340
354
|
|
|
341
|
-
- Default
|
|
342
|
-
- Fallback
|
|
355
|
+
- **Default**: automatic release when a PR is merged to `main`/`master`. The PR title (and body) drives the semver bump.
|
|
356
|
+
- **Fallback**: manual release via the `Release` workflow's `workflow_dispatch` (admin use). Select a `version_bump` (`patch`/`minor`/`major`). `use_current_version=true` skips the bump and publishes whatever is already in `lib/getstream_ruby/version.rb`.
|
|
343
357
|
|
|
344
|
-
Automatic semver bump rules
|
|
358
|
+
Automatic semver bump rules:
|
|
345
359
|
|
|
346
360
|
- `feat:` -> minor
|
|
347
361
|
- `fix:` (or `bug:`) -> patch
|
|
348
|
-
- `feat
|
|
362
|
+
- `feat!:`, `<type>(scope)!:`, or `BREAKING CHANGE` in the PR body/title -> major
|
|
363
|
+
|
|
364
|
+
PRs with any other prefix do not trigger a release.
|
|
349
365
|
|
|
350
|
-
|
|
366
|
+
The release pipeline runs lint (`make format-check && make lint && make security`), the unit suite (`make test`), and all three integration suites (chat, feed, video) on the merged commit before publishing to RubyGems. Each step is idempotent; a failed run can be re-dispatched from the Actions UI.
|
|
351
367
|
|
|
352
368
|
## License
|
|
353
369
|
|
|
@@ -13,6 +13,7 @@ require_relative 'generated/chat_client'
|
|
|
13
13
|
require_relative 'generated/video_client'
|
|
14
14
|
require_relative 'extensions/moderation_extensions'
|
|
15
15
|
require_relative 'generated/feed'
|
|
16
|
+
require_relative 'generated/webhook'
|
|
16
17
|
require_relative 'stream_response'
|
|
17
18
|
|
|
18
19
|
module GetStreamRuby
|
|
@@ -21,16 +22,15 @@ module GetStreamRuby
|
|
|
21
22
|
|
|
22
23
|
attr_reader :configuration
|
|
23
24
|
|
|
24
|
-
def initialize(config = nil, api_key: nil, api_secret: nil,
|
|
25
|
+
def initialize(config = nil, api_key: nil, api_secret: nil, **options)
|
|
25
26
|
@configuration = config || GetStreamRuby.configuration
|
|
26
27
|
|
|
27
28
|
# Create new configuration with overrides if any parameters provided
|
|
28
|
-
if api_key || api_secret ||
|
|
29
|
+
if api_key || api_secret || !options.empty?
|
|
29
30
|
@configuration = Configuration.with_overrides(
|
|
30
31
|
api_key: api_key,
|
|
31
32
|
api_secret: api_secret,
|
|
32
|
-
|
|
33
|
-
timeout: timeout,
|
|
33
|
+
**options,
|
|
34
34
|
)
|
|
35
35
|
end
|
|
36
36
|
|
|
@@ -77,6 +77,52 @@ module GetStreamRuby
|
|
|
77
77
|
GetStream::Generated::Feed.new(self, feed_group_id, feed_id)
|
|
78
78
|
end
|
|
79
79
|
|
|
80
|
+
# Verify a webhook signature using this client's API secret (CHA-2961).
|
|
81
|
+
#
|
|
82
|
+
# Convenience wrapper around StreamChat::Webhook.verify_signature that
|
|
83
|
+
# supplies the secret automatically. The module-level method is still
|
|
84
|
+
# available for callers that need to verify with an arbitrary secret.
|
|
85
|
+
#
|
|
86
|
+
# @param body [String] The raw request body (already-decompressed)
|
|
87
|
+
# @param signature [String] The signature from the X-Signature header
|
|
88
|
+
# @return [Boolean] true if the signature is valid, false otherwise
|
|
89
|
+
def verify_signature(body, signature)
|
|
90
|
+
StreamChat::Webhook.verify_signature(body, signature, @configuration.api_secret)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Verify and parse a webhook payload in one call, using this client's API
|
|
94
|
+
# secret (CHA-2961).
|
|
95
|
+
#
|
|
96
|
+
# Handles gzip-compressed bodies transparently. Raises
|
|
97
|
+
# StreamChat::Webhook::InvalidWebhookError on signature mismatch or parse
|
|
98
|
+
# failures; distinguish failure modes via the message substring.
|
|
99
|
+
#
|
|
100
|
+
# @param body [String] raw request body (possibly gzip-compressed)
|
|
101
|
+
# @param signature [String] X-Signature header value
|
|
102
|
+
# @return [Object] the typed event class instance or
|
|
103
|
+
# StreamChat::Webhook::UnknownEvent
|
|
104
|
+
# @raise [StreamChat::Webhook::InvalidWebhookError]
|
|
105
|
+
def verify_and_parse_webhook(body, signature)
|
|
106
|
+
StreamChat::Webhook.verify_and_parse_webhook(body, signature, @configuration.api_secret)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Decode + parse a Stream-delivered SQS message body.
|
|
110
|
+
#
|
|
111
|
+
# Convenience wrapper around StreamChat::Webhook.parse_sqs. No signature is
|
|
112
|
+
# required; SQS deliveries are authenticated via AWS IAM.
|
|
113
|
+
def parse_sqs(message_body)
|
|
114
|
+
StreamChat::Webhook.parse_sqs(message_body)
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Decode + parse a Stream-delivered SNS notification body.
|
|
118
|
+
#
|
|
119
|
+
# Accepts either the raw SNS HTTP envelope JSON or the pre-extracted Message
|
|
120
|
+
# string. Convenience wrapper around StreamChat::Webhook.parse_sns. No signature
|
|
121
|
+
# is required; SNS deliveries are authenticated via AWS IAM.
|
|
122
|
+
def parse_sns(notification_body)
|
|
123
|
+
StreamChat::Webhook.parse_sns(notification_body)
|
|
124
|
+
end
|
|
125
|
+
|
|
80
126
|
# @param path [String] The API path
|
|
81
127
|
# @param body [Hash] The request body
|
|
82
128
|
# @return [GetStreamRuby::StreamResponse] The API response
|
|
@@ -131,12 +177,24 @@ module GetStreamRuby
|
|
|
131
177
|
backoff_factor: 2,
|
|
132
178
|
}
|
|
133
179
|
conn.response :json, content_type: /\bjson$/
|
|
134
|
-
conn.
|
|
180
|
+
conn.headers['Connection'] = 'keep-alive' if @configuration.connection_keep_alive
|
|
181
|
+
configure_adapter(conn)
|
|
135
182
|
conn.options.timeout = @configuration.timeout
|
|
136
183
|
|
|
137
184
|
end
|
|
138
185
|
end
|
|
139
186
|
|
|
187
|
+
def configure_adapter(connection)
|
|
188
|
+
adapter = @configuration.faraday_adapter || Faraday.default_adapter
|
|
189
|
+
adapter_options = @configuration.faraday_adapter_options || {}
|
|
190
|
+
connection.adapter(adapter, **adapter_options)
|
|
191
|
+
rescue Faraday::Error, ArgumentError => e
|
|
192
|
+
@configuration.logger&.warn(
|
|
193
|
+
"Falling back to #{Faraday.default_adapter}: could not use adapter #{adapter} (#{e.message})",
|
|
194
|
+
)
|
|
195
|
+
connection.adapter Faraday.default_adapter
|
|
196
|
+
end
|
|
197
|
+
|
|
140
198
|
def generate_auth_header
|
|
141
199
|
JWT.encode(
|
|
142
200
|
{
|
|
@@ -4,9 +4,21 @@ module GetStreamRuby
|
|
|
4
4
|
|
|
5
5
|
class Configuration
|
|
6
6
|
|
|
7
|
-
attr_accessor :api_key, :api_secret, :base_url, :timeout, :logger
|
|
7
|
+
attr_accessor :api_key, :api_secret, :base_url, :timeout, :logger, :faraday_adapter, :faraday_adapter_options,
|
|
8
|
+
:connection_keep_alive
|
|
9
|
+
|
|
10
|
+
def initialize(api_key: nil, api_secret: nil, use_env: true, **options)
|
|
11
|
+
base_url = options[:base_url]
|
|
12
|
+
timeout = options[:timeout]
|
|
13
|
+
http_options = options[:http_options] || {}
|
|
14
|
+
faraday_adapter = options[:faraday_adapter] || http_options[:faraday_adapter]
|
|
15
|
+
faraday_adapter_options = options[:faraday_adapter_options] || http_options[:faraday_adapter_options]
|
|
16
|
+
connection_keep_alive = if options.key?(:connection_keep_alive)
|
|
17
|
+
options[:connection_keep_alive]
|
|
18
|
+
else
|
|
19
|
+
http_options[:connection_keep_alive]
|
|
20
|
+
end
|
|
8
21
|
|
|
9
|
-
def initialize(api_key: nil, api_secret: nil, base_url: nil, timeout: nil, use_env: true)
|
|
10
22
|
if use_env
|
|
11
23
|
@api_key = api_key || ENV.fetch('STREAM_API_KEY', nil)
|
|
12
24
|
@api_secret = api_secret || ENV.fetch('STREAM_API_SECRET', nil)
|
|
@@ -20,6 +32,13 @@ module GetStreamRuby
|
|
|
20
32
|
@timeout = timeout || 30
|
|
21
33
|
end
|
|
22
34
|
|
|
35
|
+
@faraday_adapter = (faraday_adapter || ENV.fetch('STREAM_FARADAY_ADAPTER', nil))&.to_sym
|
|
36
|
+
@faraday_adapter_options = faraday_adapter_options || default_adapter_options
|
|
37
|
+
@connection_keep_alive = if connection_keep_alive.nil?
|
|
38
|
+
ENV.fetch('STREAM_CONNECTION_KEEP_ALIVE', 'true') == 'true'
|
|
39
|
+
else
|
|
40
|
+
connection_keep_alive
|
|
41
|
+
end
|
|
23
42
|
@logger = nil
|
|
24
43
|
end
|
|
25
44
|
|
|
@@ -38,6 +57,9 @@ module GetStreamRuby
|
|
|
38
57
|
api_secret: @api_secret,
|
|
39
58
|
base_url: @base_url,
|
|
40
59
|
timeout: @timeout,
|
|
60
|
+
faraday_adapter: @faraday_adapter,
|
|
61
|
+
faraday_adapter_options: @faraday_adapter_options.dup,
|
|
62
|
+
connection_keep_alive: @connection_keep_alive,
|
|
41
63
|
)
|
|
42
64
|
end
|
|
43
65
|
|
|
@@ -47,9 +69,8 @@ module GetStreamRuby
|
|
|
47
69
|
end
|
|
48
70
|
|
|
49
71
|
# Method 1: Manual configuration (no environment variables)
|
|
50
|
-
def self.manual(api_key:, api_secret:,
|
|
51
|
-
new(api_key: api_key, api_secret: api_secret,
|
|
52
|
-
base_url: base_url, timeout: timeout, use_env: false)
|
|
72
|
+
def self.manual(api_key:, api_secret:, **options)
|
|
73
|
+
new(api_key: api_key, api_secret: api_secret, use_env: false, **options)
|
|
53
74
|
end
|
|
54
75
|
|
|
55
76
|
# Method 2: .env file (loads .env file via dotenv gem, falls back to env vars)
|
|
@@ -63,6 +84,12 @@ module GetStreamRuby
|
|
|
63
84
|
new(use_env: true)
|
|
64
85
|
end
|
|
65
86
|
|
|
87
|
+
private
|
|
88
|
+
|
|
89
|
+
def default_adapter_options
|
|
90
|
+
{}
|
|
91
|
+
end
|
|
92
|
+
|
|
66
93
|
end
|
|
67
94
|
|
|
68
95
|
end
|
|
@@ -981,6 +981,32 @@ module GetStream
|
|
|
981
981
|
)
|
|
982
982
|
end
|
|
983
983
|
|
|
984
|
+
# Searches mentionable roles (user-assignable + channel-assignable, built-in and custom) by name prefix for autocomplete
|
|
985
|
+
#
|
|
986
|
+
# @param query [String]
|
|
987
|
+
# @param limit [Integer]
|
|
988
|
+
# @param name_gt [String]
|
|
989
|
+
# @param role_type [String]
|
|
990
|
+
# @param include_global_roles [Boolean]
|
|
991
|
+
# @return [Models::SearchRolesResponse]
|
|
992
|
+
def search_roles(query, limit = nil, name_gt = nil, role_type = nil, include_global_roles = nil)
|
|
993
|
+
path = '/api/v2/roles/search'
|
|
994
|
+
# Build query parameters
|
|
995
|
+
query_params = {}
|
|
996
|
+
query_params['query'] = query unless query.nil?
|
|
997
|
+
query_params['limit'] = limit unless limit.nil?
|
|
998
|
+
query_params['name_gt'] = name_gt unless name_gt.nil?
|
|
999
|
+
query_params['role_type'] = role_type unless role_type.nil?
|
|
1000
|
+
query_params['include_global_roles'] = include_global_roles unless include_global_roles.nil?
|
|
1001
|
+
|
|
1002
|
+
# Make the API request
|
|
1003
|
+
@client.make_request(
|
|
1004
|
+
:get,
|
|
1005
|
+
path,
|
|
1006
|
+
query_params: query_params
|
|
1007
|
+
)
|
|
1008
|
+
end
|
|
1009
|
+
|
|
984
1010
|
# Deletes custom role
|
|
985
1011
|
#
|
|
986
1012
|
# @param name [String]
|
|
@@ -17,11 +17,13 @@ module GetStream
|
|
|
17
17
|
# Delete a single feed by its ID
|
|
18
18
|
#
|
|
19
19
|
# @param hard_delete [Boolean]
|
|
20
|
+
# @param purge_user_activities [Boolean]
|
|
20
21
|
# @return [Models::DeleteFeedResponse]
|
|
21
|
-
def delete_feed(hard_delete = nil)
|
|
22
|
+
def delete_feed(hard_delete = nil, purge_user_activities = nil)
|
|
22
23
|
# Build query parameters
|
|
23
24
|
query_params = {}
|
|
24
25
|
query_params['hard_delete'] = hard_delete unless hard_delete.nil?
|
|
26
|
+
query_params['purge_user_activities'] = purge_user_activities unless purge_user_activities.nil?
|
|
25
27
|
|
|
26
28
|
# Delegate to the FeedsClient
|
|
27
29
|
@client.feeds.delete_feed(@feed_group_id, @feed_id, query_params)
|
|
@@ -992,8 +992,9 @@ module GetStream
|
|
|
992
992
|
# @param feed_group_id [String]
|
|
993
993
|
# @param feed_id [String]
|
|
994
994
|
# @param hard_delete [Boolean]
|
|
995
|
+
# @param purge_user_activities [Boolean]
|
|
995
996
|
# @return [Models::DeleteFeedResponse]
|
|
996
|
-
def delete_feed(feed_group_id, feed_id, hard_delete = nil)
|
|
997
|
+
def delete_feed(feed_group_id, feed_id, hard_delete = nil, purge_user_activities = nil)
|
|
997
998
|
path = '/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}'
|
|
998
999
|
# Replace path parameters
|
|
999
1000
|
path = path.gsub('{feed_group_id}', feed_group_id.to_s)
|
|
@@ -1001,6 +1002,7 @@ module GetStream
|
|
|
1001
1002
|
# Build query parameters
|
|
1002
1003
|
query_params = {}
|
|
1003
1004
|
query_params['hard_delete'] = hard_delete unless hard_delete.nil?
|
|
1005
|
+
query_params['purge_user_activities'] = purge_user_activities unless purge_user_activities.nil?
|
|
1004
1006
|
|
|
1005
1007
|
# Make the API request
|
|
1006
1008
|
@client.make_request(
|
|
@@ -22,6 +22,9 @@ module GetStream
|
|
|
22
22
|
# @!attribute create_notification_activity
|
|
23
23
|
# @return [Boolean] Whether to create notification activities for mentioned users
|
|
24
24
|
attr_accessor :create_notification_activity
|
|
25
|
+
# @!attribute create_users
|
|
26
|
+
# @return [Boolean]
|
|
27
|
+
attr_accessor :create_users
|
|
25
28
|
# @!attribute enrich_own_fields
|
|
26
29
|
# @return [Boolean]
|
|
27
30
|
attr_accessor :enrich_own_fields
|
|
@@ -93,6 +96,7 @@ module GetStream
|
|
|
93
96
|
@feeds = attributes[:feeds] || attributes['feeds']
|
|
94
97
|
@copy_custom_to_notification = attributes[:copy_custom_to_notification] || attributes['copy_custom_to_notification'] || nil
|
|
95
98
|
@create_notification_activity = attributes[:create_notification_activity] || attributes['create_notification_activity'] || nil
|
|
99
|
+
@create_users = attributes[:create_users] || attributes['create_users'] || nil
|
|
96
100
|
@enrich_own_fields = attributes[:enrich_own_fields] || attributes['enrich_own_fields'] || nil
|
|
97
101
|
@expires_at = attributes[:expires_at] || attributes['expires_at'] || nil
|
|
98
102
|
@force_moderation = attributes[:force_moderation] || attributes['force_moderation'] || nil
|
|
@@ -123,6 +127,7 @@ module GetStream
|
|
|
123
127
|
feeds: 'feeds',
|
|
124
128
|
copy_custom_to_notification: 'copy_custom_to_notification',
|
|
125
129
|
create_notification_activity: 'create_notification_activity',
|
|
130
|
+
create_users: 'create_users',
|
|
126
131
|
enrich_own_fields: 'enrich_own_fields',
|
|
127
132
|
expires_at: 'expires_at',
|
|
128
133
|
force_moderation: 'force_moderation',
|
|
@@ -19,6 +19,9 @@ module GetStream
|
|
|
19
19
|
# @!attribute create_notification_activity
|
|
20
20
|
# @return [Boolean] Whether to create a notification activity for this reaction
|
|
21
21
|
attr_accessor :create_notification_activity
|
|
22
|
+
# @!attribute create_users
|
|
23
|
+
# @return [Boolean] Server-side only. If true, auto-creates the reacting user identified by user_id when they don't already exist. Default: false.
|
|
24
|
+
attr_accessor :create_users
|
|
22
25
|
# @!attribute enforce_unique
|
|
23
26
|
# @return [Boolean] Whether to enforce unique reactions per user (remove other reaction types from the user when adding this one)
|
|
24
27
|
attr_accessor :enforce_unique
|
|
@@ -41,6 +44,7 @@ module GetStream
|
|
|
41
44
|
@type = attributes[:type] || attributes['type']
|
|
42
45
|
@copy_custom_to_notification = attributes[:copy_custom_to_notification] || attributes['copy_custom_to_notification'] || nil
|
|
43
46
|
@create_notification_activity = attributes[:create_notification_activity] || attributes['create_notification_activity'] || nil
|
|
47
|
+
@create_users = attributes[:create_users] || attributes['create_users'] || nil
|
|
44
48
|
@enforce_unique = attributes[:enforce_unique] || attributes['enforce_unique'] || nil
|
|
45
49
|
@skip_push = attributes[:skip_push] || attributes['skip_push'] || nil
|
|
46
50
|
@user_id = attributes[:user_id] || attributes['user_id'] || nil
|
|
@@ -54,6 +58,7 @@ module GetStream
|
|
|
54
58
|
type: 'type',
|
|
55
59
|
copy_custom_to_notification: 'copy_custom_to_notification',
|
|
56
60
|
create_notification_activity: 'create_notification_activity',
|
|
61
|
+
create_users: 'create_users',
|
|
57
62
|
enforce_unique: 'enforce_unique',
|
|
58
63
|
skip_push: 'skip_push',
|
|
59
64
|
user_id: 'user_id',
|
|
@@ -15,19 +15,24 @@ module GetStream
|
|
|
15
15
|
# @!attribute display_name
|
|
16
16
|
# @return [String]
|
|
17
17
|
attr_accessor :display_name
|
|
18
|
+
# @!attribute text_type
|
|
19
|
+
# @return [String]
|
|
20
|
+
attr_accessor :text_type
|
|
18
21
|
|
|
19
22
|
# Initialize with attributes
|
|
20
23
|
def initialize(attributes = {})
|
|
21
24
|
super(attributes)
|
|
22
25
|
@name = attributes[:name] || attributes['name']
|
|
23
26
|
@display_name = attributes[:display_name] || attributes['display_name'] || nil
|
|
27
|
+
@text_type = attributes[:text_type] || attributes['text_type'] || nil
|
|
24
28
|
end
|
|
25
29
|
|
|
26
30
|
# Override field mappings for JSON serialization
|
|
27
31
|
def self.json_field_mappings
|
|
28
32
|
{
|
|
29
33
|
name: 'name',
|
|
30
|
-
display_name: 'display_name'
|
|
34
|
+
display_name: 'display_name',
|
|
35
|
+
text_type: 'text_type'
|
|
31
36
|
}
|
|
32
37
|
end
|
|
33
38
|
end
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Code generated by GetStream internal OpenAPI code generator. DO NOT EDIT.
|
|
4
|
+
|
|
5
|
+
module GetStream
|
|
6
|
+
module Generated
|
|
7
|
+
module Models
|
|
8
|
+
#
|
|
9
|
+
class ChatDraftPayloadResponse < GetStream::BaseModel
|
|
10
|
+
|
|
11
|
+
# Model attributes
|
|
12
|
+
# @!attribute id
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :id
|
|
15
|
+
# @!attribute text
|
|
16
|
+
# @return [String]
|
|
17
|
+
attr_accessor :text
|
|
18
|
+
# @!attribute custom
|
|
19
|
+
# @return [Object]
|
|
20
|
+
attr_accessor :custom
|
|
21
|
+
# @!attribute html
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :html
|
|
24
|
+
# @!attribute mml
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :mml
|
|
27
|
+
# @!attribute parent_id
|
|
28
|
+
# @return [String]
|
|
29
|
+
attr_accessor :parent_id
|
|
30
|
+
# @!attribute poll_id
|
|
31
|
+
# @return [String]
|
|
32
|
+
attr_accessor :poll_id
|
|
33
|
+
# @!attribute quoted_message_id
|
|
34
|
+
# @return [String]
|
|
35
|
+
attr_accessor :quoted_message_id
|
|
36
|
+
# @!attribute show_in_channel
|
|
37
|
+
# @return [Boolean]
|
|
38
|
+
attr_accessor :show_in_channel
|
|
39
|
+
# @!attribute silent
|
|
40
|
+
# @return [Boolean]
|
|
41
|
+
attr_accessor :silent
|
|
42
|
+
# @!attribute type
|
|
43
|
+
# @return [String]
|
|
44
|
+
attr_accessor :type
|
|
45
|
+
# @!attribute attachments
|
|
46
|
+
# @return [Array<Attachment>]
|
|
47
|
+
attr_accessor :attachments
|
|
48
|
+
# @!attribute mentioned_users
|
|
49
|
+
# @return [Array<UserResponse>]
|
|
50
|
+
attr_accessor :mentioned_users
|
|
51
|
+
|
|
52
|
+
# Initialize with attributes
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
super(attributes)
|
|
55
|
+
@id = attributes[:id] || attributes['id']
|
|
56
|
+
@text = attributes[:text] || attributes['text']
|
|
57
|
+
@custom = attributes[:custom] || attributes['custom']
|
|
58
|
+
@html = attributes[:html] || attributes['html'] || nil
|
|
59
|
+
@mml = attributes[:mml] || attributes['mml'] || nil
|
|
60
|
+
@parent_id = attributes[:parent_id] || attributes['parent_id'] || nil
|
|
61
|
+
@poll_id = attributes[:poll_id] || attributes['poll_id'] || nil
|
|
62
|
+
@quoted_message_id = attributes[:quoted_message_id] || attributes['quoted_message_id'] || nil
|
|
63
|
+
@show_in_channel = attributes[:show_in_channel] || attributes['show_in_channel'] || nil
|
|
64
|
+
@silent = attributes[:silent] || attributes['silent'] || nil
|
|
65
|
+
@type = attributes[:type] || attributes['type'] || nil
|
|
66
|
+
@attachments = attributes[:attachments] || attributes['attachments'] || nil
|
|
67
|
+
@mentioned_users = attributes[:mentioned_users] || attributes['mentioned_users'] || nil
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Override field mappings for JSON serialization
|
|
71
|
+
def self.json_field_mappings
|
|
72
|
+
{
|
|
73
|
+
id: 'id',
|
|
74
|
+
text: 'text',
|
|
75
|
+
custom: 'custom',
|
|
76
|
+
html: 'html',
|
|
77
|
+
mml: 'mml',
|
|
78
|
+
parent_id: 'parent_id',
|
|
79
|
+
poll_id: 'poll_id',
|
|
80
|
+
quoted_message_id: 'quoted_message_id',
|
|
81
|
+
show_in_channel: 'show_in_channel',
|
|
82
|
+
silent: 'silent',
|
|
83
|
+
type: 'type',
|
|
84
|
+
attachments: 'attachments',
|
|
85
|
+
mentioned_users: 'mentioned_users'
|
|
86
|
+
}
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Code generated by GetStream internal OpenAPI code generator. DO NOT EDIT.
|
|
4
|
+
|
|
5
|
+
module GetStream
|
|
6
|
+
module Generated
|
|
7
|
+
module Models
|
|
8
|
+
#
|
|
9
|
+
class ChatDraftResponse < GetStream::BaseModel
|
|
10
|
+
|
|
11
|
+
# Model attributes
|
|
12
|
+
# @!attribute channel_cid
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :channel_cid
|
|
15
|
+
# @!attribute created_at
|
|
16
|
+
# @return [DateTime]
|
|
17
|
+
attr_accessor :created_at
|
|
18
|
+
# @!attribute message
|
|
19
|
+
# @return [ChatDraftPayloadResponse]
|
|
20
|
+
attr_accessor :message
|
|
21
|
+
# @!attribute parent_id
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :parent_id
|
|
24
|
+
# @!attribute parent_message
|
|
25
|
+
# @return [ChatMessageResponse]
|
|
26
|
+
attr_accessor :parent_message
|
|
27
|
+
# @!attribute quoted_message
|
|
28
|
+
# @return [ChatMessageResponse]
|
|
29
|
+
attr_accessor :quoted_message
|
|
30
|
+
|
|
31
|
+
# Initialize with attributes
|
|
32
|
+
def initialize(attributes = {})
|
|
33
|
+
super(attributes)
|
|
34
|
+
@channel_cid = attributes[:channel_cid] || attributes['channel_cid']
|
|
35
|
+
@created_at = attributes[:created_at] || attributes['created_at']
|
|
36
|
+
@message = attributes[:message] || attributes['message']
|
|
37
|
+
@parent_id = attributes[:parent_id] || attributes['parent_id'] || nil
|
|
38
|
+
@parent_message = attributes[:parent_message] || attributes['parent_message'] || nil
|
|
39
|
+
@quoted_message = attributes[:quoted_message] || attributes['quoted_message'] || nil
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Override field mappings for JSON serialization
|
|
43
|
+
def self.json_field_mappings
|
|
44
|
+
{
|
|
45
|
+
channel_cid: 'channel_cid',
|
|
46
|
+
created_at: 'created_at',
|
|
47
|
+
message: 'message',
|
|
48
|
+
parent_id: 'parent_id',
|
|
49
|
+
parent_message: 'parent_message',
|
|
50
|
+
quoted_message: 'quoted_message'
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -52,16 +52,16 @@ module GetStream
|
|
|
52
52
|
# @return [DateTime]
|
|
53
53
|
attr_accessor :updated_at
|
|
54
54
|
# @!attribute attachments
|
|
55
|
-
# @return [Array]
|
|
55
|
+
# @return [Array<Attachment>]
|
|
56
56
|
attr_accessor :attachments
|
|
57
57
|
# @!attribute latest_reactions
|
|
58
|
-
# @return [Array]
|
|
58
|
+
# @return [Array<ChatReactionResponse>]
|
|
59
59
|
attr_accessor :latest_reactions
|
|
60
60
|
# @!attribute mentioned_users
|
|
61
61
|
# @return [Array<UserResponse>]
|
|
62
62
|
attr_accessor :mentioned_users
|
|
63
63
|
# @!attribute own_reactions
|
|
64
|
-
# @return [Array]
|
|
64
|
+
# @return [Array<ChatReactionResponse>]
|
|
65
65
|
attr_accessor :own_reactions
|
|
66
66
|
# @!attribute restricted_visibility
|
|
67
67
|
# @return [Array<String>]
|
|
@@ -84,6 +84,9 @@ module GetStream
|
|
|
84
84
|
# @!attribute deleted_at
|
|
85
85
|
# @return [DateTime]
|
|
86
86
|
attr_accessor :deleted_at
|
|
87
|
+
# @!attribute deleted_for_me
|
|
88
|
+
# @return [Boolean]
|
|
89
|
+
attr_accessor :deleted_for_me
|
|
87
90
|
# @!attribute message_text_updated_at
|
|
88
91
|
# @return [DateTime]
|
|
89
92
|
attr_accessor :message_text_updated_at
|
|
@@ -108,18 +111,48 @@ module GetStream
|
|
|
108
111
|
# @!attribute show_in_channel
|
|
109
112
|
# @return [Boolean]
|
|
110
113
|
attr_accessor :show_in_channel
|
|
114
|
+
# @!attribute mentioned_group_ids
|
|
115
|
+
# @return [Array<String>]
|
|
116
|
+
attr_accessor :mentioned_group_ids
|
|
117
|
+
# @!attribute mentioned_roles
|
|
118
|
+
# @return [Array<String>]
|
|
119
|
+
attr_accessor :mentioned_roles
|
|
120
|
+
# @!attribute thread_participants
|
|
121
|
+
# @return [Array<UserResponse>]
|
|
122
|
+
attr_accessor :thread_participants
|
|
123
|
+
# @!attribute draft
|
|
124
|
+
# @return [ChatDraftResponse]
|
|
125
|
+
attr_accessor :draft
|
|
111
126
|
# @!attribute i18n
|
|
112
127
|
# @return [Hash<String, String>]
|
|
113
128
|
attr_accessor :i18n
|
|
114
129
|
# @!attribute image_labels
|
|
115
130
|
# @return [Hash<String, Array<String>>]
|
|
116
131
|
attr_accessor :image_labels
|
|
132
|
+
# @!attribute member
|
|
133
|
+
# @return [ChannelMemberResponse]
|
|
134
|
+
attr_accessor :member
|
|
135
|
+
# @!attribute moderation
|
|
136
|
+
# @return [ChatModerationV2Response]
|
|
137
|
+
attr_accessor :moderation
|
|
117
138
|
# @!attribute pinned_by
|
|
118
139
|
# @return [UserResponse]
|
|
119
140
|
attr_accessor :pinned_by
|
|
141
|
+
# @!attribute poll
|
|
142
|
+
# @return [PollResponseData]
|
|
143
|
+
attr_accessor :poll
|
|
120
144
|
# @!attribute quoted_message
|
|
121
145
|
# @return [ChatMessageResponse]
|
|
122
146
|
attr_accessor :quoted_message
|
|
147
|
+
# @!attribute reaction_groups
|
|
148
|
+
# @return [Hash<String, ChatReactionGroupResponse>]
|
|
149
|
+
attr_accessor :reaction_groups
|
|
150
|
+
# @!attribute reminder
|
|
151
|
+
# @return [ChatReminderResponseData]
|
|
152
|
+
attr_accessor :reminder
|
|
153
|
+
# @!attribute shared_location
|
|
154
|
+
# @return [ChatSharedLocationResponseData]
|
|
155
|
+
attr_accessor :shared_location
|
|
123
156
|
|
|
124
157
|
# Initialize with attributes
|
|
125
158
|
def initialize(attributes = {})
|
|
@@ -149,6 +182,7 @@ module GetStream
|
|
|
149
182
|
@user = attributes[:user] || attributes['user']
|
|
150
183
|
@command = attributes[:command] || attributes['command'] || nil
|
|
151
184
|
@deleted_at = attributes[:deleted_at] || attributes['deleted_at'] || nil
|
|
185
|
+
@deleted_for_me = attributes[:deleted_for_me] || attributes['deleted_for_me'] || nil
|
|
152
186
|
@message_text_updated_at = attributes[:message_text_updated_at] || attributes['message_text_updated_at'] || nil
|
|
153
187
|
@mml = attributes[:mml] || attributes['mml'] || nil
|
|
154
188
|
@parent_id = attributes[:parent_id] || attributes['parent_id'] || nil
|
|
@@ -157,10 +191,20 @@ module GetStream
|
|
|
157
191
|
@poll_id = attributes[:poll_id] || attributes['poll_id'] || nil
|
|
158
192
|
@quoted_message_id = attributes[:quoted_message_id] || attributes['quoted_message_id'] || nil
|
|
159
193
|
@show_in_channel = attributes[:show_in_channel] || attributes['show_in_channel'] || nil
|
|
194
|
+
@mentioned_group_ids = attributes[:mentioned_group_ids] || attributes['mentioned_group_ids'] || nil
|
|
195
|
+
@mentioned_roles = attributes[:mentioned_roles] || attributes['mentioned_roles'] || nil
|
|
196
|
+
@thread_participants = attributes[:thread_participants] || attributes['thread_participants'] || nil
|
|
197
|
+
@draft = attributes[:draft] || attributes['draft'] || nil
|
|
160
198
|
@i18n = attributes[:i18n] || attributes['i18n'] || nil
|
|
161
199
|
@image_labels = attributes[:image_labels] || attributes['image_labels'] || nil
|
|
200
|
+
@member = attributes[:member] || attributes['member'] || nil
|
|
201
|
+
@moderation = attributes[:moderation] || attributes['moderation'] || nil
|
|
162
202
|
@pinned_by = attributes[:pinned_by] || attributes['pinned_by'] || nil
|
|
203
|
+
@poll = attributes[:poll] || attributes['poll'] || nil
|
|
163
204
|
@quoted_message = attributes[:quoted_message] || attributes['quoted_message'] || nil
|
|
205
|
+
@reaction_groups = attributes[:reaction_groups] || attributes['reaction_groups'] || nil
|
|
206
|
+
@reminder = attributes[:reminder] || attributes['reminder'] || nil
|
|
207
|
+
@shared_location = attributes[:shared_location] || attributes['shared_location'] || nil
|
|
164
208
|
end
|
|
165
209
|
|
|
166
210
|
# Override field mappings for JSON serialization
|
|
@@ -191,6 +235,7 @@ module GetStream
|
|
|
191
235
|
user: 'user',
|
|
192
236
|
command: 'command',
|
|
193
237
|
deleted_at: 'deleted_at',
|
|
238
|
+
deleted_for_me: 'deleted_for_me',
|
|
194
239
|
message_text_updated_at: 'message_text_updated_at',
|
|
195
240
|
mml: 'mml',
|
|
196
241
|
parent_id: 'parent_id',
|
|
@@ -199,10 +244,20 @@ module GetStream
|
|
|
199
244
|
poll_id: 'poll_id',
|
|
200
245
|
quoted_message_id: 'quoted_message_id',
|
|
201
246
|
show_in_channel: 'show_in_channel',
|
|
247
|
+
mentioned_group_ids: 'mentioned_group_ids',
|
|
248
|
+
mentioned_roles: 'mentioned_roles',
|
|
249
|
+
thread_participants: 'thread_participants',
|
|
250
|
+
draft: 'draft',
|
|
202
251
|
i18n: 'i18n',
|
|
203
252
|
image_labels: 'image_labels',
|
|
253
|
+
member: 'member',
|
|
254
|
+
moderation: 'moderation',
|
|
204
255
|
pinned_by: 'pinned_by',
|
|
205
|
-
|
|
256
|
+
poll: 'poll',
|
|
257
|
+
quoted_message: 'quoted_message',
|
|
258
|
+
reaction_groups: 'reaction_groups',
|
|
259
|
+
reminder: 'reminder',
|
|
260
|
+
shared_location: 'shared_location'
|
|
206
261
|
}
|
|
207
262
|
end
|
|
208
263
|
end
|