whatsapp_sdk 0.12.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.cursorrules +53 -0
  3. data/.github/workflows/codeql-analysis.yml +8 -6
  4. data/.gitignore +1 -0
  5. data/.rubocop.yml +0 -3
  6. data/CHANGELOG.md +19 -7
  7. data/Gemfile +1 -4
  8. data/Gemfile.lock +9 -23
  9. data/README.md +148 -223
  10. data/SECURITY.md +21 -0
  11. data/example.rb +217 -125
  12. data/lib/whatsapp_sdk/api/api_configuration.rb +2 -5
  13. data/lib/whatsapp_sdk/api/business_profile.rb +12 -26
  14. data/lib/whatsapp_sdk/api/client.rb +31 -43
  15. data/lib/whatsapp_sdk/api/medias.rb +31 -46
  16. data/lib/whatsapp_sdk/api/messages.rb +28 -142
  17. data/lib/whatsapp_sdk/api/phone_numbers.rb +32 -36
  18. data/lib/whatsapp_sdk/api/request.rb +2 -2
  19. data/lib/whatsapp_sdk/api/responses/generic_error_response.rb +12 -30
  20. data/lib/whatsapp_sdk/api/responses/http_response_error.rb +18 -0
  21. data/lib/whatsapp_sdk/api/responses/id_response.rb +15 -0
  22. data/lib/whatsapp_sdk/api/responses/message_data_response.rb +18 -37
  23. data/lib/whatsapp_sdk/api/responses/pagination_records.rb +17 -0
  24. data/lib/whatsapp_sdk/api/responses/success_response.rb +3 -20
  25. data/lib/whatsapp_sdk/api/templates.rb +30 -63
  26. data/lib/whatsapp_sdk/configuration.rb +2 -24
  27. data/lib/whatsapp_sdk/error.rb +0 -1
  28. data/lib/whatsapp_sdk/resource/address.rb +1 -30
  29. data/lib/whatsapp_sdk/resource/address_type.rb +3 -8
  30. data/lib/whatsapp_sdk/resource/business_profile.rb +28 -3
  31. data/lib/whatsapp_sdk/resource/button_parameter.rb +4 -20
  32. data/lib/whatsapp_sdk/resource/component.rb +12 -43
  33. data/lib/whatsapp_sdk/resource/contact.rb +1 -30
  34. data/lib/whatsapp_sdk/resource/contact_response.rb +1 -9
  35. data/lib/whatsapp_sdk/resource/currency.rb +0 -8
  36. data/lib/whatsapp_sdk/resource/date_time.rb +0 -6
  37. data/lib/whatsapp_sdk/resource/email.rb +1 -10
  38. data/lib/whatsapp_sdk/resource/errors.rb +3 -17
  39. data/lib/whatsapp_sdk/resource/interactive.rb +6 -27
  40. data/lib/whatsapp_sdk/resource/interactive_action.rb +10 -24
  41. data/lib/whatsapp_sdk/resource/interactive_action_reply_button.rb +5 -19
  42. data/lib/whatsapp_sdk/resource/interactive_action_section.rb +1 -11
  43. data/lib/whatsapp_sdk/resource/interactive_action_section_row.rb +0 -11
  44. data/lib/whatsapp_sdk/resource/interactive_body.rb +0 -10
  45. data/lib/whatsapp_sdk/resource/interactive_footer.rb +0 -10
  46. data/lib/whatsapp_sdk/resource/interactive_header.rb +25 -53
  47. data/lib/whatsapp_sdk/resource/location.rb +44 -0
  48. data/lib/whatsapp_sdk/resource/media.rb +28 -114
  49. data/lib/whatsapp_sdk/resource/media_component.rb +89 -0
  50. data/lib/whatsapp_sdk/resource/media_types.rb +0 -3
  51. data/lib/whatsapp_sdk/resource/message.rb +0 -5
  52. data/lib/whatsapp_sdk/resource/message_template_namespace.rb +17 -0
  53. data/lib/whatsapp_sdk/resource/name.rb +1 -28
  54. data/lib/whatsapp_sdk/resource/org.rb +1 -13
  55. data/lib/whatsapp_sdk/resource/parameter_object.rb +71 -74
  56. data/lib/whatsapp_sdk/resource/phone_number.rb +40 -22
  57. data/lib/whatsapp_sdk/resource/phone_number_component.rb +25 -0
  58. data/lib/whatsapp_sdk/resource/template.rb +43 -36
  59. data/lib/whatsapp_sdk/resource/url.rb +1 -10
  60. data/lib/whatsapp_sdk/version.rb +1 -2
  61. data/lib/whatsapp_sdk.rb +0 -4
  62. data/whatsapp_sdk.gemspec +1 -4
  63. metadata +13 -62
  64. data/lib/whatsapp_sdk/api/response.rb +0 -51
  65. data/lib/whatsapp_sdk/api/responses/business_profile_data_response.rb +0 -56
  66. data/lib/whatsapp_sdk/api/responses/data_response.rb +0 -26
  67. data/lib/whatsapp_sdk/api/responses/error_response.rb +0 -32
  68. data/lib/whatsapp_sdk/api/responses/media_data_response.rb +0 -48
  69. data/lib/whatsapp_sdk/api/responses/message_error_response.rb +0 -13
  70. data/lib/whatsapp_sdk/api/responses/message_template_namespace_data_response.rb +0 -37
  71. data/lib/whatsapp_sdk/api/responses/phone_number_data_response.rb +0 -60
  72. data/lib/whatsapp_sdk/api/responses/phone_numbers_data_response.rb +0 -39
  73. data/lib/whatsapp_sdk/api/responses/read_message_data_response.rb +0 -34
  74. data/lib/whatsapp_sdk/api/responses/template_data_response.rb +0 -51
  75. data/lib/whatsapp_sdk/api/responses/templates_data_response.rb +0 -39
  76. data/sorbet/config +0 -6
  77. data/sorbet/rbi/annotations/faraday.rbi +0 -17
  78. data/sorbet/rbi/annotations/mocha.rbi +0 -34
  79. data/sorbet/rbi/annotations/rainbow.rbi +0 -269
  80. data/sorbet/rbi/gems/faraday-multipart@1.0.4.rbi +0 -270
  81. data/sorbet/rbi/gems/faraday-net_http@2.0.3.rbi +0 -182
  82. data/sorbet/rbi/gems/faraday@2.3.0.rbi +0 -2494
  83. data/sorbet/rbi/gems/method_source@1.0.0.rbi +0 -272
  84. data/sorbet/rbi/gems/minitest@5.16.1.rbi +0 -1459
  85. data/sorbet/rbi/gems/mocha@1.14.0.rbi +0 -60
  86. data/sorbet/rbi/gems/multipart-post@2.2.3.rbi +0 -239
  87. data/sorbet/rbi/gems/netrc@0.11.0.rbi +0 -150
  88. data/sorbet/rbi/gems/oj@3.13.14.rbi +0 -589
  89. data/sorbet/rbi/gems/zeitwerk@2.6.0.rbi +0 -867
  90. data/sorbet/rbi/todo.rbi +0 -8
  91. data/sorbet/shims/request.rbi +0 -10
  92. data/sorbet/tapioca/config.yml +0 -13
  93. data/sorbet/tapioca/require.rb +0 -4
@@ -1,39 +0,0 @@
1
- # typed: strict
2
- # frozen_string_literal: true
3
-
4
- require_relative "data_response"
5
- require_relative "template_data_response"
6
-
7
- module WhatsappSdk
8
- module Api
9
- module Responses
10
- class TemplatesDataResponse < DataResponse
11
- sig { returns(T::Array[TemplateDataResponse]) }
12
- attr_reader :templates
13
-
14
- sig { params(response: T::Hash[T.untyped, T.untyped]).void }
15
- def initialize(response)
16
- @templates = T.let(
17
- response['data']&.map { |template| parse_templates(template) },
18
- T::Array[TemplateDataResponse]
19
- )
20
- super(response)
21
- end
22
-
23
- sig { override.params(response: T::Hash[T.untyped, T.untyped]).returns(T.nilable(TemplatesDataResponse)) }
24
- def self.build_from_response(response:)
25
- return unless response["data"]
26
-
27
- new(response)
28
- end
29
-
30
- private
31
-
32
- sig { params(template: T::Hash[T.untyped, T.untyped]).returns(TemplateDataResponse) }
33
- def parse_templates(template)
34
- TemplateDataResponse.new(response: template)
35
- end
36
- end
37
- end
38
- end
39
- end
data/sorbet/config DELETED
@@ -1,6 +0,0 @@
1
- --dir
2
- .
3
- --ignore=vendor/
4
- --ignore=testing.rb
5
- --ignore=example.rb
6
- --enable-experimental-requires-ancestor
@@ -1,17 +0,0 @@
1
- # typed: strict
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This file was pulled from a central RBI files repository.
5
- # Please run `bin/tapioca annotations` to update it.
6
-
7
- module Faraday
8
- class << self
9
- sig { params(url: T.untyped, options: T::Hash[Symbol, T.untyped], block: T.nilable(T.proc.params(connection: Faraday::Connection).void)).returns(Faraday::Connection) }
10
- def new(url = nil, options = {}, &block); end
11
- end
12
- end
13
-
14
- class Faraday::Response
15
- sig { returns(T::Boolean) }
16
- def success?; end
17
- end
@@ -1,34 +0,0 @@
1
- # typed: strict
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This file was pulled from a central RBI files repository.
5
- # Please run `bin/tapioca annotations` to update it.
6
-
7
- module Mocha::API
8
- sig { params(arguments: T.untyped).returns(Mocha::Mock) }
9
- def mock(*arguments); end
10
-
11
- sig { params(arguments: T.untyped).returns(T.untyped) }
12
- def stub(*arguments); end
13
- end
14
-
15
- module Mocha::ClassMethods
16
- sig { returns(Mocha::Mock) }
17
- def any_instance; end
18
- end
19
-
20
- class Mocha::Expectation
21
- sig { params(expected_parameters: T.untyped, matching_block: T.nilable(T.proc.params(actual_parameters: T.untyped).void)).returns(Mocha::Expectation) }
22
- def with(*expected_parameters, &matching_block); end
23
-
24
- sig { params(values: T.untyped).returns(Mocha::Expectation) }
25
- def returns(*values); end
26
- end
27
-
28
- module Mocha::ObjectMethods
29
- sig { params(expected_methods_vs_return_values: T.untyped).returns(Mocha::Expectation) }
30
- def expects(expected_methods_vs_return_values); end
31
-
32
- sig { params(stubbed_methods_vs_return_values: T.untyped).returns(Mocha::Expectation) }
33
- def stubs(stubbed_methods_vs_return_values); end
34
- end
@@ -1,269 +0,0 @@
1
- # typed: strict
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This file was pulled from a central RBI files repository.
5
- # Please run `bin/tapioca annotations` to update it.
6
-
7
- module Rainbow
8
- # @shim: https://github.com/sickill/rainbow/blob/master/lib/rainbow.rb#L10-L12
9
- sig { returns(T::Boolean) }
10
- attr_accessor :enabled
11
-
12
- class Color
13
- sig { returns(Symbol) }
14
- attr_reader :ground
15
-
16
- sig { params(ground: Symbol, values: T.any([Integer], [Integer, Integer, Integer])).returns(Color) }
17
- def self.build(ground, values); end
18
-
19
- sig { params(hex: String).returns([Integer, Integer, Integer]) }
20
- def self.parse_hex_color(hex); end
21
-
22
- class Indexed < Rainbow::Color
23
- sig { returns(Integer) }
24
- attr_reader :num
25
-
26
- sig { params(ground: Symbol, num: Integer).void }
27
- def initialize(ground, num); end
28
-
29
- sig { returns(T::Array[Integer]) }
30
- def codes; end
31
- end
32
-
33
- class Named < Rainbow::Color::Indexed
34
- NAMES = T.let(nil, T::Hash[Symbol, Integer])
35
-
36
- sig { params(ground: Symbol, name: Symbol).void }
37
- def initialize(ground, name); end
38
-
39
- sig { returns(T::Array[Symbol]) }
40
- def self.color_names; end
41
-
42
- sig { returns(String) }
43
- def self.valid_names; end
44
- end
45
-
46
- class RGB < Rainbow::Color::Indexed
47
- sig { returns(Integer) }
48
- attr_reader :r, :g, :b
49
-
50
- sig { params(ground: Symbol, values: Integer).void }
51
- def initialize(ground, *values); end
52
-
53
- sig { returns(T::Array[Integer]) }
54
- def codes; end
55
-
56
- sig { params(value: Numeric).returns(Integer) }
57
- def self.to_ansi_domain(value); end
58
- end
59
-
60
- class X11Named < Rainbow::Color::RGB
61
- include Rainbow::X11ColorNames
62
-
63
- sig { returns(T::Array[Symbol]) }
64
- def self.color_names; end
65
-
66
- sig { returns(String) }
67
- def self.valid_names; end
68
-
69
- sig { params(ground: Symbol, name: Symbol).void }
70
- def initialize(ground, name); end
71
- end
72
- end
73
-
74
- sig { returns(Wrapper) }
75
- def self.global; end
76
-
77
- sig { returns(T::Boolean) }
78
- def self.enabled; end
79
-
80
- sig { params(value: T::Boolean).returns(T::Boolean) }
81
- def self.enabled=(value); end
82
-
83
- sig { params(string: String).returns(String) }
84
- def self.uncolor(string); end
85
-
86
- class NullPresenter < String
87
- sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
88
- def color(*values); end
89
-
90
- sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
91
- def foreground(*values); end
92
-
93
- sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
94
- def fg(*values); end
95
-
96
- sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
97
- def background(*values); end
98
-
99
- sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
100
- def bg(*values); end
101
-
102
- sig { returns(NullPresenter) }
103
- def reset; end
104
-
105
- sig { returns(NullPresenter) }
106
- def bright; end
107
-
108
- sig { returns(NullPresenter) }
109
- def faint; end
110
-
111
- sig { returns(NullPresenter) }
112
- def italic; end
113
-
114
- sig { returns(NullPresenter) }
115
- def underline; end
116
-
117
- sig { returns(NullPresenter) }
118
- def blink; end
119
-
120
- sig { returns(NullPresenter) }
121
- def inverse; end
122
-
123
- sig { returns(NullPresenter) }
124
- def hide; end
125
-
126
- sig { returns(NullPresenter) }
127
- def cross_out; end
128
-
129
- sig { returns(NullPresenter) }
130
- def black; end
131
-
132
- sig { returns(NullPresenter) }
133
- def red; end
134
-
135
- sig { returns(NullPresenter) }
136
- def green; end
137
-
138
- sig { returns(NullPresenter) }
139
- def yellow; end
140
-
141
- sig { returns(NullPresenter) }
142
- def blue; end
143
-
144
- sig { returns(NullPresenter) }
145
- def magenta; end
146
-
147
- sig { returns(NullPresenter) }
148
- def cyan; end
149
-
150
- sig { returns(NullPresenter) }
151
- def white; end
152
-
153
- sig { returns(NullPresenter) }
154
- def bold; end
155
-
156
- sig { returns(NullPresenter) }
157
- def dark; end
158
-
159
- sig { returns(NullPresenter) }
160
- def strike; end
161
- end
162
-
163
- class Presenter < String
164
- TERM_EFFECTS = T.let(nil, T::Hash[Symbol, Integer])
165
-
166
- sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
167
- def color(*values); end
168
-
169
- sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
170
- def foreground(*values); end
171
-
172
- sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
173
- def fg(*values); end
174
-
175
- sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
176
- def background(*values); end
177
-
178
- sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
179
- def bg(*values); end
180
-
181
- sig { returns(Presenter) }
182
- def reset; end
183
-
184
- sig { returns(Presenter) }
185
- def bright; end
186
-
187
- sig { returns(Presenter) }
188
- def faint; end
189
-
190
- sig { returns(Presenter) }
191
- def italic; end
192
-
193
- sig { returns(Presenter) }
194
- def underline; end
195
-
196
- sig { returns(Presenter) }
197
- def blink; end
198
-
199
- sig { returns(Presenter) }
200
- def inverse; end
201
-
202
- sig { returns(Presenter) }
203
- def hide; end
204
-
205
- sig { returns(Presenter) }
206
- def cross_out; end
207
-
208
- sig { returns(Presenter) }
209
- def black; end
210
-
211
- sig { returns(Presenter) }
212
- def red; end
213
-
214
- sig { returns(Presenter) }
215
- def green; end
216
-
217
- sig { returns(Presenter) }
218
- def yellow; end
219
-
220
- sig { returns(Presenter) }
221
- def blue; end
222
-
223
- sig { returns(Presenter) }
224
- def magenta; end
225
-
226
- sig { returns(Presenter) }
227
- def cyan; end
228
-
229
- sig { returns(Presenter) }
230
- def white; end
231
-
232
- sig { returns(Presenter) }
233
- def bold; end
234
-
235
- sig { returns(Presenter) }
236
- def dark; end
237
-
238
- sig { returns(Presenter) }
239
- def strike; end
240
- end
241
-
242
- class StringUtils
243
- sig { params(string: String, codes: T::Array[Integer]).returns(String) }
244
- def self.wrap_with_sgr(string, codes); end
245
-
246
- sig { params(string: String).returns(String) }
247
- def self.uncolor(string); end
248
- end
249
-
250
- VERSION = T.let(nil, String)
251
-
252
- class Wrapper
253
- sig { returns(T::Boolean) }
254
- attr_accessor :enabled
255
-
256
- sig { params(enabled: T::Boolean).void }
257
- def initialize(enabled = true); end
258
-
259
- sig { params(string: String).returns(T.any(Rainbow::Presenter, Rainbow::NullPresenter)) }
260
- def wrap(string); end
261
- end
262
-
263
- module X11ColorNames
264
- NAMES = T.let(nil, T::Hash[Symbol, [Integer, Integer, Integer]])
265
- end
266
- end
267
-
268
- sig { params(string: String).returns(Rainbow::Presenter) }
269
- def Rainbow(string); end
@@ -1,270 +0,0 @@
1
- # typed: true
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This is an autogenerated file for types exported from the `faraday-multipart` gem.
5
- # Please instead update this file by running `bin/tapioca gem faraday-multipart`.
6
-
7
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/version.rb:3
8
- module Faraday
9
- class << self
10
- # source://faraday-2.3.0/lib/faraday.rb:55
11
- def default_adapter; end
12
-
13
- # source://faraday-2.3.0/lib/faraday.rb:102
14
- def default_adapter=(adapter); end
15
-
16
- # source://faraday-2.3.0/lib/faraday.rb:59
17
- def default_adapter_options; end
18
-
19
- # source://faraday-2.3.0/lib/faraday.rb:59
20
- def default_adapter_options=(_arg0); end
21
-
22
- # source://faraday-2.3.0/lib/faraday.rb:120
23
- def default_connection; end
24
-
25
- # source://faraday-2.3.0/lib/faraday.rb:62
26
- def default_connection=(_arg0); end
27
-
28
- # source://faraday-2.3.0/lib/faraday.rb:127
29
- def default_connection_options; end
30
-
31
- # source://faraday-2.3.0/lib/faraday.rb:134
32
- def default_connection_options=(options); end
33
-
34
- # source://faraday-2.3.0/lib/faraday.rb:67
35
- def ignore_env_proxy; end
36
-
37
- # source://faraday-2.3.0/lib/faraday.rb:67
38
- def ignore_env_proxy=(_arg0); end
39
-
40
- # source://faraday-2.3.0/lib/faraday.rb:46
41
- def lib_path; end
42
-
43
- # source://faraday-2.3.0/lib/faraday.rb:46
44
- def lib_path=(_arg0); end
45
-
46
- # source://faraday-2.3.0/lib/faraday.rb:96
47
- def new(url = T.unsafe(nil), options = T.unsafe(nil), &block); end
48
-
49
- # source://faraday-2.3.0/lib/faraday.rb:107
50
- def respond_to_missing?(symbol, include_private = T.unsafe(nil)); end
51
-
52
- # source://faraday-2.3.0/lib/faraday.rb:42
53
- def root_path; end
54
-
55
- # source://faraday-2.3.0/lib/faraday.rb:42
56
- def root_path=(_arg0); end
57
-
58
- private
59
-
60
- # source://faraday-2.3.0/lib/faraday.rb:143
61
- def method_missing(name, *args, &block); end
62
- end
63
- end
64
-
65
- # source://faraday-2.3.0/lib/faraday.rb:34
66
- Faraday::CONTENT_TYPE = T.let(T.unsafe(nil), String)
67
-
68
- # source://faraday-multipart-1.0.4/lib/faraday/multipart.rb:18
69
- Faraday::CompositeReadIO = Faraday::Multipart::CompositeReadIO
70
-
71
- # Aliases for Faraday v1, these are all deprecated and will be removed in v2 of this middleware
72
- #
73
- # source://faraday-multipart-1.0.4/lib/faraday/multipart.rb:15
74
- Faraday::FilePart = Multipart::Post::UploadIO
75
-
76
- # source://faraday-2.3.0/lib/faraday/methods.rb:5
77
- Faraday::METHODS_WITH_BODY = T.let(T.unsafe(nil), Array)
78
-
79
- # source://faraday-2.3.0/lib/faraday/methods.rb:4
80
- Faraday::METHODS_WITH_QUERY = T.let(T.unsafe(nil), Array)
81
-
82
- # Main Faraday::Multipart module.
83
- #
84
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/version.rb:5
85
- module Faraday::Multipart
86
- class << self
87
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/version.rb:8
88
- def multipart_post_version; end
89
- end
90
- end
91
-
92
- # Similar to, but not compatible with CompositeReadIO provided by the
93
- # multipart-post gem.
94
- # https://github.com/nicksieger/multipart-post/blob/master/lib/composite_io.rb
95
- #
96
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/file_part.rb:67
97
- class Faraday::Multipart::CompositeReadIO
98
- # @return [CompositeReadIO] a new instance of CompositeReadIO
99
- #
100
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/file_part.rb:68
101
- def initialize(*parts); end
102
-
103
- # Close each of the IOs.
104
- #
105
- # @return [void]
106
- #
107
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/file_part.rb:111
108
- def close; end
109
-
110
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/file_part.rb:115
111
- def ensure_open_and_readable; end
112
-
113
- # @return [Integer] sum of the lengths of all the parts
114
- #
115
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/file_part.rb:75
116
- def length; end
117
-
118
- # Read from IOs in order until `length` bytes have been received.
119
- #
120
- # @param length [Integer, nil]
121
- # @param outbuf [String, nil]
122
- #
123
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/file_part.rb:91
124
- def read(length = T.unsafe(nil), outbuf = T.unsafe(nil)); end
125
-
126
- # Rewind each of the IOs and reset the index to 0.
127
- #
128
- # @return [void]
129
- #
130
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/file_part.rb:82
131
- def rewind; end
132
-
133
- private
134
-
135
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/file_part.rb:125
136
- def advance_io; end
137
-
138
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/file_part.rb:121
139
- def current_io; end
140
- end
141
-
142
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/file_part.rb:55
143
- Faraday::Multipart::FilePart = Multipart::Post::UploadIO
144
-
145
- # Middleware for supporting multi-part requests.
146
- #
147
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/middleware.rb:8
148
- class Faraday::Multipart::Middleware < ::Faraday::Request::UrlEncoded
149
- # @return [Middleware] a new instance of Middleware
150
- #
151
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/middleware.rb:13
152
- def initialize(app = T.unsafe(nil), options = T.unsafe(nil)); end
153
-
154
- # Checks for files in the payload, otherwise leaves everything untouched.
155
- #
156
- # @param env [Faraday::Env]
157
- #
158
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/middleware.rb:21
159
- def call(env); end
160
-
161
- # @param env [Faraday::Env]
162
- # @param params [Hash]
163
- #
164
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/middleware.rb:55
165
- def create_multipart(env, params); end
166
-
167
- # Returns true if obj is an enumerable with values that are multipart.
168
- #
169
- # @param obj [Object]
170
- # @return [Boolean]
171
- #
172
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/middleware.rb:44
173
- def has_multipart?(obj); end
174
-
175
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/middleware.rb:67
176
- def part(boundary, key, value); end
177
-
178
- # @param params [Hash]
179
- # @param prefix [String]
180
- # @param pieces [Array]
181
- #
182
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/middleware.rb:83
183
- def process_params(params, prefix = T.unsafe(nil), pieces = T.unsafe(nil), &block); end
184
-
185
- # @param env [Faraday::Env]
186
- # @return [Boolean]
187
- #
188
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/middleware.rb:32
189
- def process_request?(env); end
190
-
191
- # @return [String]
192
- #
193
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/middleware.rb:76
194
- def unique_boundary; end
195
- end
196
-
197
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/middleware.rb:9
198
- Faraday::Multipart::Middleware::DEFAULT_BOUNDARY_PREFIX = T.let(T.unsafe(nil), String)
199
-
200
- # Multipart value used to POST data with a content type.
201
- #
202
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/param_part.rb:6
203
- class Faraday::Multipart::ParamPart
204
- # @param value [String] Uploaded content as a String.
205
- # @param content_type [String] String content type of the value.
206
- # @param content_id [String] Optional String of this value's Content-ID.
207
- # @return [Faraday::ParamPart]
208
- #
209
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/param_part.rb:12
210
- def initialize(value, content_type, content_id = T.unsafe(nil)); end
211
-
212
- # The value's content ID, if given.
213
- #
214
- # @return [String, nil]
215
- #
216
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/param_part.rb:52
217
- def content_id; end
218
-
219
- # The value's content type.
220
- #
221
- # @return [String]
222
- #
223
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/param_part.rb:47
224
- def content_type; end
225
-
226
- # Returns a Hash of String key/value pairs.
227
- #
228
- # @return [Hash]
229
- #
230
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/param_part.rb:32
231
- def headers; end
232
-
233
- # Converts this value to a form part.
234
- #
235
- # @param boundary [String] String multipart boundary that must not exist in
236
- # the content exactly.
237
- # @param key [String] String key name for this value.
238
- # @return [Faraday::Parts::Part]
239
- #
240
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/param_part.rb:25
241
- def to_part(boundary, key); end
242
-
243
- # The content to upload.
244
- #
245
- # @return [String]
246
- #
247
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/param_part.rb:42
248
- def value; end
249
- end
250
-
251
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/file_part.rb:56
252
- Faraday::Multipart::Parts = Multipart::Post::Parts
253
-
254
- # source://faraday-multipart-1.0.4/lib/faraday/multipart/version.rb:6
255
- Faraday::Multipart::VERSION = T.let(T.unsafe(nil), String)
256
-
257
- # source://faraday-multipart-1.0.4/lib/faraday/multipart.rb:16
258
- Faraday::ParamPart = Faraday::Multipart::ParamPart
259
-
260
- # source://faraday-multipart-1.0.4/lib/faraday/multipart.rb:17
261
- Faraday::Parts = Multipart::Post::Parts
262
-
263
- # multipart-post v2.2.0 introduces a new class hierarchy for classes like Parts and UploadIO
264
- # For backwards compatibility, detect the gem version and use the right class
265
- #
266
- # source://faraday-multipart-1.0.4/lib/faraday/multipart.rb:21
267
- Faraday::UploadIO = Multipart::Post::UploadIO
268
-
269
- # source://faraday-2.3.0/lib/faraday/version.rb:4
270
- Faraday::VERSION = T.let(T.unsafe(nil), String)