privat_bank_business_api 0.2.1

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.
Files changed (102) hide show
  1. checksums.yaml +7 -0
  2. data/.devcontainer/Dockerfile +17 -0
  3. data/.devcontainer/devcontainer.json +33 -0
  4. data/.devcontainer/post-create.sh +8 -0
  5. data/.rspec +3 -0
  6. data/.rubocop.yml +9 -0
  7. data/.vscode/settings.json +6 -0
  8. data/CHANGELOG.md +12 -0
  9. data/CODE_OF_CONDUCT.md +132 -0
  10. data/LICENSE.txt +21 -0
  11. data/README.md +123 -0
  12. data/Rakefile +12 -0
  13. data/lib/pb_api/base_transformer.rb +19 -0
  14. data/lib/pb_api/client.rb +41 -0
  15. data/lib/pb_api/models/balance.rb +79 -0
  16. data/lib/pb_api/models/base_struct.rb +30 -0
  17. data/lib/pb_api/models/transaction.rb +114 -0
  18. data/lib/pb_api/pagination_helper.rb +73 -0
  19. data/lib/pb_api/resource.rb +97 -0
  20. data/lib/pb_api/resources/balance_resource.rb +40 -0
  21. data/lib/pb_api/resources/transaction_resource.rb +105 -0
  22. data/lib/pb_api/transformers/balance_transformer.rb +35 -0
  23. data/lib/pb_api/transformers/transaction_transformer.rb +46 -0
  24. data/lib/pb_api/types.rb +8 -0
  25. data/lib/pb_api/version.rb +5 -0
  26. data/lib/pb_api.rb +34 -0
  27. data/sig/privat_bank_buisness_api.rbs +4 -0
  28. data/sorbet/config +4 -0
  29. data/sorbet/rbi/annotations/.gitattributes +1 -0
  30. data/sorbet/rbi/annotations/faraday.rbi +17 -0
  31. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  32. data/sorbet/rbi/gems/.gitattributes +1 -0
  33. data/sorbet/rbi/gems/ast@2.4.2.rbi +585 -0
  34. data/sorbet/rbi/gems/benchmark@0.4.0.rbi +618 -0
  35. data/sorbet/rbi/gems/bigdecimal@3.1.9.rbi +9 -0
  36. data/sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi +9 -0
  37. data/sorbet/rbi/gems/date@3.4.1.rbi +75 -0
  38. data/sorbet/rbi/gems/diff-lcs@1.6.0.rbi +1134 -0
  39. data/sorbet/rbi/gems/dry-core@1.1.0.rbi +9 -0
  40. data/sorbet/rbi/gems/dry-inflector@1.2.0.rbi +9 -0
  41. data/sorbet/rbi/gems/dry-logic@1.6.0.rbi +9 -0
  42. data/sorbet/rbi/gems/dry-struct@1.7.1.rbi +925 -0
  43. data/sorbet/rbi/gems/dry-transformer@1.0.1.rbi +1512 -0
  44. data/sorbet/rbi/gems/dry-types@1.8.2.rbi +9 -0
  45. data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
  46. data/sorbet/rbi/gems/faraday-em_http@1.0.0.rbi +9 -0
  47. data/sorbet/rbi/gems/faraday-em_synchrony@1.0.0.rbi +9 -0
  48. data/sorbet/rbi/gems/faraday-excon@1.1.0.rbi +9 -0
  49. data/sorbet/rbi/gems/faraday-httpclient@1.0.1.rbi +9 -0
  50. data/sorbet/rbi/gems/faraday-multipart@1.1.0.rbi +9 -0
  51. data/sorbet/rbi/gems/faraday-net_http@1.0.2.rbi +9 -0
  52. data/sorbet/rbi/gems/faraday-net_http_persistent@1.2.0.rbi +9 -0
  53. data/sorbet/rbi/gems/faraday-patron@1.0.0.rbi +9 -0
  54. data/sorbet/rbi/gems/faraday-rack@1.0.0.rbi +9 -0
  55. data/sorbet/rbi/gems/faraday-retry@1.0.3.rbi +9 -0
  56. data/sorbet/rbi/gems/faraday@1.10.4.rbi +9 -0
  57. data/sorbet/rbi/gems/faraday_middleware@1.2.1.rbi +9 -0
  58. data/sorbet/rbi/gems/i18n@1.14.7.rbi +2208 -0
  59. data/sorbet/rbi/gems/ice_nine@0.11.2.rbi +9 -0
  60. data/sorbet/rbi/gems/io-console@0.8.0.rbi +9 -0
  61. data/sorbet/rbi/gems/json@2.10.1.rbi +2120 -0
  62. data/sorbet/rbi/gems/language_server-protocol@3.17.0.4.rbi +9 -0
  63. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +86 -0
  64. data/sorbet/rbi/gems/logger@1.6.6.rbi +940 -0
  65. data/sorbet/rbi/gems/money@6.19.0.rbi +2260 -0
  66. data/sorbet/rbi/gems/multipart-post@2.4.1.rbi +9 -0
  67. data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
  68. data/sorbet/rbi/gems/parallel@1.26.3.rbi +291 -0
  69. data/sorbet/rbi/gems/parser@3.3.7.1.rbi +5525 -0
  70. data/sorbet/rbi/gems/pp@0.6.2.rbi +368 -0
  71. data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +477 -0
  72. data/sorbet/rbi/gems/prism@1.3.0.rbi +41403 -0
  73. data/sorbet/rbi/gems/psych@5.2.3.rbi +2435 -0
  74. data/sorbet/rbi/gems/racc@1.8.1.rbi +164 -0
  75. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
  76. data/sorbet/rbi/gems/rake@13.2.1.rbi +3028 -0
  77. data/sorbet/rbi/gems/rbi@0.2.4.rbi +4542 -0
  78. data/sorbet/rbi/gems/rdoc@6.12.0.rbi +12758 -0
  79. data/sorbet/rbi/gems/regexp_parser@2.10.0.rbi +3795 -0
  80. data/sorbet/rbi/gems/reline@0.6.0.rbi +2451 -0
  81. data/sorbet/rbi/gems/rspec-core@3.13.3.rbi +10986 -0
  82. data/sorbet/rbi/gems/rspec-expectations@3.13.3.rbi +8183 -0
  83. data/sorbet/rbi/gems/rspec-mocks@3.13.2.rbi +5341 -0
  84. data/sorbet/rbi/gems/rspec-support@3.13.2.rbi +1630 -0
  85. data/sorbet/rbi/gems/rspec@3.13.0.rbi +83 -0
  86. data/sorbet/rbi/gems/rubocop-ast@1.38.0.rbi +7654 -0
  87. data/sorbet/rbi/gems/rubocop@1.72.2.rbi +61026 -0
  88. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
  89. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +9 -0
  90. data/sorbet/rbi/gems/spoom@1.5.4.rbi +5026 -0
  91. data/sorbet/rbi/gems/stringio@3.1.5.rbi +9 -0
  92. data/sorbet/rbi/gems/tapioca@0.16.11.rbi +3656 -0
  93. data/sorbet/rbi/gems/thor@1.3.2.rbi +4378 -0
  94. data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +132 -0
  95. data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +251 -0
  96. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
  97. data/sorbet/rbi/gems/yard@0.9.37.rbi +18379 -0
  98. data/sorbet/rbi/gems/zeitwerk@2.7.2.rbi +9 -0
  99. data/sorbet/rbi/todo.rbi +17 -0
  100. data/sorbet/tapioca/config.yml +13 -0
  101. data/sorbet/tapioca/require.rb +8 -0
  102. metadata +231 -0
@@ -0,0 +1,925 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `dry-struct` gem.
5
+ # Please instead update this file by running `bin/tapioca gem dry-struct`.
6
+
7
+
8
+ # source://dry-struct//lib/dry/struct/class_interface.rb#5
9
+ module Dry
10
+ class << self
11
+ # source://dry-core/1.1.0/lib/dry/core.rb#52
12
+ def Equalizer(*keys, **options); end
13
+
14
+ # Constructor method for easily creating a {Dry::Struct}.
15
+ #
16
+ # @example
17
+ # require 'dry-struct'
18
+ #
19
+ # module Types
20
+ # include Dry.Types()
21
+ # end
22
+ #
23
+ # Person = Dry.Struct(name: Types::String, age: Types::Integer)
24
+ # matz = Person.new(name: "Matz", age: 52)
25
+ # matz.name #=> "Matz"
26
+ # matz.age #=> 52
27
+ #
28
+ # Test = Dry.Struct(expected: Types::String) { schema(schema.strict) }
29
+ # Test[expected: "foo", unexpected: "bar"]
30
+ # #=> Dry::Struct::Error: [Test.new] unexpected keys [:unexpected] in Hash input
31
+ # @return [Dry::Struct]
32
+ #
33
+ # source://dry-struct//lib/dry/struct.rb#30
34
+ def Struct(attributes = T.unsafe(nil), &block); end
35
+
36
+ # source://dry-types/1.8.2/lib/dry/types.rb#253
37
+ def Types(*namespaces, default: T.unsafe(nil), **aliases); end
38
+ end
39
+ end
40
+
41
+ # Typed {Struct} with virtus-like DSL for defining schema.
42
+ #
43
+ # ### Differences between dry-struct and virtus
44
+ #
45
+ # {Struct} look somewhat similar to [Virtus][] but there are few significant differences:
46
+ #
47
+ # * {Struct}s don't provide attribute writers and are meant to be used
48
+ # as "data objects" exclusively.
49
+ # * Handling of attribute values is provided by standalone type objects from
50
+ # [`dry-types`][].
51
+ # * Handling of attribute hashes is provided by standalone hash schemas from
52
+ # [`dry-types`][].
53
+ # * Struct classes quack like [`dry-types`][], which means you can use them
54
+ # in hash schemas, as array members or sum them
55
+ #
56
+ # {Struct} class can specify a constructor type, which uses [hash schemas][]
57
+ # to handle attributes in `.new` method.
58
+ #
59
+ # [`dry-types`]: https://github.com/dry-rb/dry-types
60
+ # [Virtus]: https://github.com/solnic/virtus
61
+ # [hash schemas]: http://dry-rb.org/gems/dry-types/hash-schemas
62
+ #
63
+ # @example
64
+ # require 'dry-struct'
65
+ #
66
+ # module Types
67
+ # include Dry.Types()
68
+ # end
69
+ #
70
+ # class Book < Dry::Struct
71
+ # attribute :title, Types::String
72
+ # attribute :subtitle, Types::String.optional
73
+ # end
74
+ #
75
+ # rom_n_roda = Book.new(
76
+ # title: 'Web Development with ROM and Roda',
77
+ # subtitle: nil
78
+ # )
79
+ # rom_n_roda.title #=> 'Web Development with ROM and Roda'
80
+ # rom_n_roda.subtitle #=> nil
81
+ #
82
+ # refactoring = Book.new(
83
+ # title: 'Refactoring',
84
+ # subtitle: 'Improving the Design of Existing Code'
85
+ # )
86
+ # refactoring.title #=> 'Refactoring'
87
+ # refactoring.subtitle #=> 'Improving the Design of Existing Code'
88
+ #
89
+ # source://dry-struct//lib/dry/struct/class_interface.rb#6
90
+ class Dry::Struct
91
+ include ::Dry::Core::Constants
92
+ include ::Dry::Core::Equalizer::Methods
93
+ extend ::Dry::Core::Extensions
94
+ extend ::Dry::Core::Constants
95
+ extend ::Dry::Core::ClassAttributes
96
+ extend ::Dry::Types::Type
97
+ extend ::Dry::Types::Builder
98
+ extend ::Dry::Struct::ClassInterface
99
+ extend ::Dry::Core::Deprecations::Interface
100
+
101
+ # @param attributes [Hash, #each]
102
+ # @return [Struct] a new instance of Struct
103
+ #
104
+ # source://dry-struct//lib/dry/struct.rb#126
105
+ def initialize(attributes); end
106
+
107
+ # Retrieves value of previously defined attribute by its' `name`
108
+ #
109
+ # @example
110
+ # class Book < Dry::Struct
111
+ # attribute :title, Types::String
112
+ # attribute :subtitle, Types::String.optional
113
+ # end
114
+ #
115
+ # rom_n_roda = Book.new(
116
+ # title: 'Web Development with ROM and Roda',
117
+ # subtitle: nil
118
+ # )
119
+ # rom_n_roda[:title] #=> 'Web Development with ROM and Roda'
120
+ # rom_n_roda[:subtitle] #=> nil
121
+ # @param name [String]
122
+ # @return [Object]
123
+ #
124
+ # source://dry-struct//lib/dry/struct.rb#147
125
+ def [](name); end
126
+
127
+ # Returns the value of attribute attributes.
128
+ #
129
+ # source://dry-struct//lib/dry/struct.rb#122
130
+ def __attributes__; end
131
+
132
+ # Create a copy of {Dry::Struct} with overriden attributes
133
+ #
134
+ # @example
135
+ # class Book < Dry::Struct
136
+ # attribute :title, Types::String
137
+ # attribute :subtitle, Types::String.optional
138
+ # end
139
+ #
140
+ # rom_n_roda = Book.new(
141
+ # title: 'Web Development with ROM and Roda',
142
+ # subtitle: '2nd edition'
143
+ # )
144
+ # #=> #<Book title="Web Development with ROM and Roda" subtitle="2nd edition">
145
+ #
146
+ # rom_n_roda.new(subtitle: '3rd edition')
147
+ # #=> #<Book title="Web Development with ROM and Roda" subtitle="3rd edition">
148
+ # @param changeset [Hash{Symbol => Object}]
149
+ # @return [Struct]
150
+ #
151
+ # source://dry-struct//lib/dry/struct.rb#202
152
+ def __new__(changeset); end
153
+
154
+ # Returns the value of attribute attributes.
155
+ #
156
+ # source://dry-struct//lib/dry/struct.rb#122
157
+ def attributes; end
158
+
159
+ # Pattern matching support
160
+ #
161
+ # @api private
162
+ #
163
+ # source://dry-struct//lib/dry/struct.rb#224
164
+ def deconstruct_keys(_keys); end
165
+
166
+ # @return [String]
167
+ #
168
+ # source://dry-struct//lib/dry/struct.rb#215
169
+ def inspect; end
170
+
171
+ # Create a copy of {Dry::Struct} with overriden attributes
172
+ #
173
+ # @example
174
+ # class Book < Dry::Struct
175
+ # attribute :title, Types::String
176
+ # attribute :subtitle, Types::String.optional
177
+ # end
178
+ #
179
+ # rom_n_roda = Book.new(
180
+ # title: 'Web Development with ROM and Roda',
181
+ # subtitle: '2nd edition'
182
+ # )
183
+ # #=> #<Book title="Web Development with ROM and Roda" subtitle="2nd edition">
184
+ #
185
+ # rom_n_roda.new(subtitle: '3rd edition')
186
+ # #=> #<Book title="Web Development with ROM and Roda" subtitle="3rd edition">
187
+ # @param changeset [Hash{Symbol => Object}]
188
+ # @return [Struct]
189
+ #
190
+ # source://dry-struct//lib/dry/struct.rb#202
191
+ def new(changeset); end
192
+
193
+ # Converts the {Dry::Struct} to a hash with keys representing
194
+ # each attribute (as symbols) and their corresponding values
195
+ #
196
+ # @example
197
+ # class Book < Dry::Struct
198
+ # attribute :title, Types::String
199
+ # attribute :subtitle, Types::String.optional
200
+ # end
201
+ #
202
+ # rom_n_roda = Book.new(
203
+ # title: 'Web Development with ROM and Roda',
204
+ # subtitle: nil
205
+ # )
206
+ # rom_n_roda.to_hash
207
+ # #=> {title: 'Web Development with ROM and Roda', subtitle: nil}
208
+ # @return [Hash{Symbol => Object}]
209
+ #
210
+ # source://dry-struct//lib/dry/struct.rb#174
211
+ def to_h; end
212
+
213
+ # Converts the {Dry::Struct} to a hash with keys representing
214
+ # each attribute (as symbols) and their corresponding values
215
+ # TODO: remove in 2.0
216
+ #
217
+ # @example
218
+ # class Book < Dry::Struct
219
+ # attribute :title, Types::String
220
+ # attribute :subtitle, Types::String.optional
221
+ # end
222
+ #
223
+ # rom_n_roda = Book.new(
224
+ # title: 'Web Development with ROM and Roda',
225
+ # subtitle: nil
226
+ # )
227
+ # rom_n_roda.to_hash
228
+ # #=> {title: 'Web Development with ROM and Roda', subtitle: nil}
229
+ # @return [Hash{Symbol => Object}]
230
+ #
231
+ # source://dry-struct//lib/dry/struct.rb#174
232
+ def to_hash; end
233
+
234
+ class << self
235
+ # source://dry-struct//lib/dry/struct.rb#94
236
+ def loader; end
237
+
238
+ def prepend(*_arg0); end
239
+ end
240
+ end
241
+
242
+ # Class-level interface of {Struct} and {Value}
243
+ #
244
+ # source://dry-struct//lib/dry/struct/class_interface.rb#8
245
+ module Dry::Struct::ClassInterface
246
+ include ::Dry::Core::Constants
247
+ include ::Dry::Core::ClassAttributes
248
+ include ::Dry::Types::Type
249
+ include ::Dry::Types::Builder
250
+
251
+ # @param other [Object, Dry::Struct]
252
+ # @return [Boolean]
253
+ #
254
+ # source://dry-struct//lib/dry/struct/class_interface.rb#331
255
+ def ===(other); end
256
+
257
+ # Make the struct abstract. This class will be used as a default
258
+ # parent class for nested structs
259
+ #
260
+ # source://dry-struct//lib/dry/struct/class_interface.rb#387
261
+ def abstract; end
262
+
263
+ # Adds an attribute for this {Struct} with given `name` and `type`
264
+ # and modifies {.schema} accordingly.
265
+ #
266
+ # @example with nested structs
267
+ # class Language < Dry::Struct
268
+ # attribute :name, Types::String
269
+ # attribute :details, Dry::Struct do
270
+ # attribute :type, Types::String
271
+ # end
272
+ # end
273
+ #
274
+ # Language.schema # new lines for readability
275
+ # # => #<Dry::Types[
276
+ # Constructor<Schema<keys={
277
+ # name: Constrained<Nominal<String> rule=[type?(String)]>
278
+ # details: Language::Details
279
+ # }> fn=Kernel.Hash>]>
280
+ #
281
+ # ruby = Language.new(name: 'Ruby', details: { type: 'OO' })
282
+ # ruby.name #=> 'Ruby'
283
+ # ruby.details #=> #<Language::Details type="OO">
284
+ # ruby.details.type #=> 'OO'
285
+ # @example with a nested array of structs
286
+ # class Language < Dry::Struct
287
+ # attribute :name, Types::String
288
+ # attribute :versions, Types::Array.of(Types::String)
289
+ # attribute :celebrities, Types::Array.of(Dry::Struct) do
290
+ # attribute :name, Types::String
291
+ # attribute :pseudonym, Types::String
292
+ # end
293
+ # end
294
+ #
295
+ # Language.schema # new lines for readability
296
+ # => #<Dry::Types[Constructor<Schema<keys={
297
+ # name: Constrained<Nominal<String> rule=[type?(String)]>
298
+ # versions: Constrained<
299
+ # Array<Constrained<Nominal<String> rule=[type?(String)]>
300
+ # > rule=[type?(Array)]>
301
+ # celebrities: Constrained<Array<Language::Celebrity> rule=[type?(Array)]>
302
+ # }> fn=Kernel.Hash>]>
303
+ #
304
+ # ruby = Language.new(
305
+ # name: 'Ruby',
306
+ # versions: %w(1.8.7 1.9.8 2.0.1),
307
+ # celebrities: [
308
+ # { name: 'Yukihiro Matsumoto', pseudonym: 'Matz' },
309
+ # { name: 'Aaron Patterson', pseudonym: 'tenderlove' }
310
+ # ]
311
+ # )
312
+ # ruby.name #=> 'Ruby'
313
+ # ruby.versions #=> ['1.8.7', '1.9.8', '2.0.1']
314
+ # ruby.celebrities
315
+ # #=> [
316
+ # #<Language::Celebrity name='Yukihiro Matsumoto' pseudonym='Matz'>,
317
+ # #<Language::Celebrity name='Aaron Patterson' pseudonym='tenderlove'>
318
+ # ]
319
+ # ruby.celebrities[0].name #=> 'Yukihiro Matsumoto'
320
+ # ruby.celebrities[0].pseudonym #=> 'Matz'
321
+ # ruby.celebrities[1].name #=> 'Aaron Patterson'
322
+ # ruby.celebrities[1].pseudonym #=> 'tenderlove'
323
+ # @param name [Symbol] name of the defined attribute
324
+ # @param type [Dry::Types::Type, nil] or superclass of nested type
325
+ # @raise [RepeatedAttributeError] when trying to define attribute with the
326
+ # same name as previously defined one
327
+ # @return [Dry::Struct]
328
+ # @yield If a block is given, it will be evaluated in the context of
329
+ # a new struct class, and set as a nested type for the given
330
+ # attribute. A class with a matching name will also be defined for
331
+ # the nested type.
332
+ #
333
+ # source://dry-struct//lib/dry/struct/class_interface.rb#86
334
+ def attribute(name, type = T.unsafe(nil), &_arg2); end
335
+
336
+ # Adds an omittable (key is not required on initialization) attribute for this {Struct}
337
+ #
338
+ # @example
339
+ # class User < Dry::Struct
340
+ # attribute :name, Types::String
341
+ # attribute? :email, Types::String
342
+ # end
343
+ #
344
+ # User.new(name: 'John') # => #<User name="John" email=nil>
345
+ # @param name [Symbol] name of the defined attribute
346
+ # @param type [Dry::Types::Type, nil] or superclass of nested type
347
+ # @return [Dry::Struct]
348
+ #
349
+ # source://dry-struct//lib/dry/struct/class_interface.rb#139
350
+ def attribute?(*args, &_arg1); end
351
+
352
+ # Gets the list of attribute names
353
+ #
354
+ # @return [Array<Symbol>]
355
+ #
356
+ # source://dry-struct//lib/dry/struct/class_interface.rb#357
357
+ def attribute_names; end
358
+
359
+ # @example
360
+ # class Book < Dry::Struct
361
+ # attributes(
362
+ # title: Types::String,
363
+ # author: Types::String
364
+ # )
365
+ # end
366
+ #
367
+ # Book.schema
368
+ # # => #<Dry::Types[Constructor<Schema<keys={
369
+ # # title: Constrained<Nominal<String> rule=[type?(String)]>
370
+ # # author: Constrained<Nominal<String> rule=[type?(String)]>
371
+ # # }> fn=Kernel.Hash>]>
372
+ # @param new_schema [Hash{Symbol => Dry::Types::Type}]
373
+ # @raise [RepeatedAttributeError] when trying to define attribute with the
374
+ # same name as previously defined one
375
+ # @return [Dry::Struct]
376
+ # @see #attribute
377
+ #
378
+ # source://dry-struct//lib/dry/struct/class_interface.rb#173
379
+ def attributes(new_schema); end
380
+
381
+ # Add atributes from another struct
382
+ #
383
+ # @example
384
+ # class Address < Dry::Struct
385
+ # attribute :city, Types::String
386
+ # attribute :country, Types::String
387
+ # end
388
+ #
389
+ # class User < Dry::Struct
390
+ # attribute :name, Types::String
391
+ # attributes_from Address
392
+ # end
393
+ #
394
+ # User.new(name: 'Quispe', city: 'La Paz', country: 'Bolivia')
395
+ # @example with nested structs
396
+ # class User < Dry::Struct
397
+ # attribute :name, Types::String
398
+ # attribute :address do
399
+ # attributes_from Address
400
+ # end
401
+ # end
402
+ # @param struct [Dry::Struct]
403
+ #
404
+ # source://dry-struct//lib/dry/struct/class_interface.rb#114
405
+ def attributes_from(struct); end
406
+
407
+ # @api private
408
+ #
409
+ # source://dry-struct//lib/dry/struct/class_interface.rb#261
410
+ def call_safe(input, &_arg1); end
411
+
412
+ # @api private
413
+ #
414
+ # source://dry-struct//lib/dry/struct/class_interface.rb#270
415
+ def call_unsafe(input); end
416
+
417
+ # @return [true]
418
+ #
419
+ # source://dry-struct//lib/dry/struct/class_interface.rb#335
420
+ def constrained?; end
421
+
422
+ # @param constructor [#call, nil]
423
+ # @param block [#call, nil]
424
+ # @return [Dry::Struct::Constructor]
425
+ #
426
+ # source://dry-struct//lib/dry/struct/class_interface.rb#288
427
+ def constructor(constructor = T.unsafe(nil), **_arg1, &block); end
428
+
429
+ # @return [false]
430
+ #
431
+ # source://dry-struct//lib/dry/struct/class_interface.rb#327
432
+ def default?; end
433
+
434
+ # @param args [({Symbol => Object})]
435
+ # @return [Dry::Types::Result::Failure]
436
+ #
437
+ # source://dry-struct//lib/dry/struct/class_interface.rb#320
438
+ def failure(*args); end
439
+
440
+ # Checks if this {Struct} has the given attribute
441
+ #
442
+ # @param key [Symbol] Attribute name
443
+ # @return [Boolean]
444
+ #
445
+ # source://dry-struct//lib/dry/struct/class_interface.rb#352
446
+ def has_attribute?(key); end
447
+
448
+ # @api private
449
+ #
450
+ # source://dry-struct//lib/dry/struct/class_interface.rb#279
451
+ def load(attributes); end
452
+
453
+ # @return [{Symbol => Object}]
454
+ #
455
+ # source://dry-struct//lib/dry/struct/class_interface.rb#362
456
+ def meta(meta = T.unsafe(nil)); end
457
+
458
+ # @param attributes [Hash{Symbol => Object}, Dry::Struct]
459
+ # @raise [Struct::Error] if the given attributes don't conform {#schema}
460
+ #
461
+ # source://dry-struct//lib/dry/struct/class_interface.rb#239
462
+ def new(attributes = T.unsafe(nil), safe = T.unsafe(nil), &_arg2); end
463
+
464
+ # @return [false]
465
+ #
466
+ # source://dry-struct//lib/dry/struct/class_interface.rb#341
467
+ def optional?; end
468
+
469
+ # @return [self]
470
+ #
471
+ # source://dry-struct//lib/dry/struct/class_interface.rb#338
472
+ def primitive; end
473
+
474
+ # @param other [Object, Dry::Struct]
475
+ # @return [Boolean]
476
+ #
477
+ # source://dry-struct//lib/dry/struct/class_interface.rb#331
478
+ def primitive?(other); end
479
+
480
+ # @param klass [Class]
481
+ # @param args [({Symbol => Object})]
482
+ #
483
+ # source://dry-struct//lib/dry/struct/class_interface.rb#324
484
+ def result(klass, *args); end
485
+
486
+ # @param args [({Symbol => Object})]
487
+ # @return [Dry::Types::Result::Success]
488
+ #
489
+ # source://dry-struct//lib/dry/struct/class_interface.rb#316
490
+ def success(*args); end
491
+
492
+ # Dump to the AST
493
+ #
494
+ # @api public
495
+ # @return [Array]
496
+ #
497
+ # source://dry-struct//lib/dry/struct/class_interface.rb#396
498
+ def to_ast(meta: T.unsafe(nil)); end
499
+
500
+ # @return [Proc]
501
+ #
502
+ # source://dry-struct//lib/dry/struct/class_interface.rb#344
503
+ def to_proc; end
504
+
505
+ # Add an arbitrary transformation for input hash keys.
506
+ #
507
+ # @example
508
+ # class Book < Dry::Struct
509
+ # transform_keys(&:to_sym)
510
+ #
511
+ # attribute :title, Types::String
512
+ # end
513
+ #
514
+ # Book.new('title' => "The Old Man and the Sea")
515
+ # # => #<Book title="The Old Man and the Sea">
516
+ # @param proc [#call, nil]
517
+ # @param block [#call, nil]
518
+ #
519
+ # source://dry-struct//lib/dry/struct/class_interface.rb#221
520
+ def transform_keys(proc = T.unsafe(nil), &block); end
521
+
522
+ # Add an arbitrary transformation for new attribute types.
523
+ #
524
+ # @example
525
+ # class Book < Dry::Struct
526
+ # transform_types { |t| t.meta(struct: :Book) }
527
+ #
528
+ # attribute :title, Types::String
529
+ # end
530
+ #
531
+ # Book.schema.key(:title).meta # => { struct: :Book }
532
+ # @param proc [#call, nil]
533
+ # @param block [#call, nil]
534
+ #
535
+ # source://dry-struct//lib/dry/struct/class_interface.rb#204
536
+ def transform_types(proc = T.unsafe(nil), &block); end
537
+
538
+ # @param input [Hash{Symbol => Object}, Dry::Struct]
539
+ # @return [Dry::Types::Result]
540
+ # @yieldparam failure [Dry::Types::Result::Failure]
541
+ # @yieldreturn [Dry::Types::Result]
542
+ #
543
+ # source://dry-struct//lib/dry/struct/class_interface.rb#296
544
+ def try(input); end
545
+
546
+ # @param input [Hash{Symbol => Object}, Dry::Struct]
547
+ # @private
548
+ # @return [Dry::Types::Result]
549
+ #
550
+ # source://dry-struct//lib/dry/struct/class_interface.rb#306
551
+ def try_struct(input); end
552
+
553
+ # Build a sum type
554
+ #
555
+ # @param type [Dry::Types::Type]
556
+ # @return [Dry::Types::Sum]
557
+ #
558
+ # source://dry-struct//lib/dry/struct/class_interface.rb#377
559
+ def |(type); end
560
+
561
+ private
562
+
563
+ # Constructs a type
564
+ #
565
+ # @return [Dry::Types::Type, Dry::Struct]
566
+ #
567
+ # source://dry-struct//lib/dry/struct/class_interface.rb#430
568
+ def build_type(name, type = T.unsafe(nil), &_arg2); end
569
+
570
+ # @param new_keys [Hash{Symbol => Dry::Types::Type, Dry::Struct}]
571
+ # @raise [RepeatedAttributeError] when trying to define attribute with the
572
+ # same name as previously defined one
573
+ #
574
+ # source://dry-struct//lib/dry/struct/class_interface.rb#228
575
+ def check_schema_duplication(new_keys); end
576
+
577
+ # Retrieves default attributes from defined {.schema}.
578
+ # Used in a {Struct} constructor if no attributes provided to {.new}
579
+ #
580
+ # @return [Hash{Symbol => Object}]
581
+ #
582
+ # source://dry-struct//lib/dry/struct/class_interface.rb#411
583
+ def default_attributes(default_schema = T.unsafe(nil)); end
584
+
585
+ # @api private
586
+ #
587
+ # source://dry-struct//lib/dry/struct/class_interface.rb#452
588
+ def define_accessors(keys); end
589
+
590
+ # Checks if the given type is a Dry::Struct
591
+ #
592
+ # @param type [Dry::Types::Type]
593
+ # @return [Boolean]
594
+ #
595
+ # source://dry-struct//lib/dry/struct/class_interface.rb#422
596
+ def struct?(type); end
597
+
598
+ # Stores an object for building nested struct classes
599
+ #
600
+ # @return [StructBuilder]
601
+ #
602
+ # source://dry-struct//lib/dry/struct/class_interface.rb#402
603
+ def struct_builder; end
604
+
605
+ # @api private
606
+ # @return [Boolean]
607
+ #
608
+ # source://dry-struct//lib/dry/struct/class_interface.rb#468
609
+ def valid_method_name?(key); end
610
+ end
611
+
612
+ # source://dry-struct//lib/dry/struct/compiler.rb#5
613
+ class Dry::Struct::Compiler < ::Dry::Types::Compiler
614
+ # source://dry-struct//lib/dry/struct/compiler.rb#6
615
+ def visit_struct(node); end
616
+ end
617
+
618
+ # source://dry-struct//lib/dry/struct/constructor.rb#5
619
+ class Dry::Struct::Constructor < ::Dry::Types::Constructor
620
+ # source://dry-types/1.8.2/lib/dry/types/constructor.rb#16
621
+ def primitive; end
622
+ end
623
+
624
+ # Raised when given input doesn't conform schema and constructor type
625
+ #
626
+ # source://dry-struct//lib/dry/struct/errors.rb#6
627
+ class Dry::Struct::Error < ::Dry::Types::CoercionError; end
628
+
629
+ # Helper for {Struct#to_hash} implementation
630
+ #
631
+ # source://dry-struct//lib/dry/struct/hashify.rb#6
632
+ module Dry::Struct::Hashify
633
+ class << self
634
+ # Converts value to hash recursively
635
+ #
636
+ # @param value [#to_hash, #map, Object]
637
+ # @return [Hash, Array]
638
+ #
639
+ # source://dry-struct//lib/dry/struct/hashify.rb#10
640
+ def [](value); end
641
+ end
642
+ end
643
+
644
+ # Raised when a struct doesn't have an attribute
645
+ #
646
+ # source://dry-struct//lib/dry/struct/errors.rb#18
647
+ class Dry::Struct::MissingAttributeError < ::KeyError
648
+ # @return [MissingAttributeError] a new instance of MissingAttributeError
649
+ #
650
+ # source://dry-struct//lib/dry/struct/errors.rb#19
651
+ def initialize(attribute:, klass:); end
652
+ end
653
+
654
+ # When struct class stored in ast was garbage collected because no alive objects exists
655
+ # This shouldn't happen in a working application
656
+ #
657
+ # source://dry-struct//lib/dry/struct/errors.rb#26
658
+ class Dry::Struct::RecycledStructError < ::RuntimeError
659
+ # @return [RecycledStructError] a new instance of RecycledStructError
660
+ #
661
+ # source://dry-struct//lib/dry/struct/errors.rb#27
662
+ def initialize; end
663
+ end
664
+
665
+ # Raised when defining duplicate attributes
666
+ #
667
+ # source://dry-struct//lib/dry/struct/errors.rb#9
668
+ class Dry::Struct::RepeatedAttributeError < ::ArgumentError
669
+ # @param key [Symbol] attribute name that is the same as previously defined one
670
+ # @return [RepeatedAttributeError] a new instance of RepeatedAttributeError
671
+ #
672
+ # source://dry-struct//lib/dry/struct/errors.rb#12
673
+ def initialize(key); end
674
+ end
675
+
676
+ # @private
677
+ #
678
+ # source://dry-struct//lib/dry/struct/struct_builder.rb#6
679
+ class Dry::Struct::StructBuilder < ::Dry::Struct::Compiler
680
+ # @return [StructBuilder] a new instance of StructBuilder
681
+ #
682
+ # source://dry-struct//lib/dry/struct/struct_builder.rb#9
683
+ def initialize(struct); end
684
+
685
+ # @param attr_name [Symbol|String] the name of the nested type
686
+ # @param type [Dry::Struct, Dry::Types::Type::Array, Undefined] the superclass
687
+ # of the nested struct
688
+ # @yield the body of the nested struct
689
+ #
690
+ # source://dry-struct//lib/dry/struct/struct_builder.rb#18
691
+ def call(attr_name, type, &block); end
692
+
693
+ # Returns the value of attribute struct.
694
+ #
695
+ # source://dry-struct//lib/dry/struct/struct_builder.rb#7
696
+ def struct; end
697
+
698
+ private
699
+
700
+ # @return [Boolean]
701
+ #
702
+ # source://dry-struct//lib/dry/struct/struct_builder.rb#48
703
+ def array?(type); end
704
+
705
+ # source://dry-struct//lib/dry/struct/struct_builder.rb#75
706
+ def check_name(name); end
707
+
708
+ # source://dry-struct//lib/dry/struct/struct_builder.rb#64
709
+ def const_name(type, attr_name); end
710
+
711
+ # @return [Boolean]
712
+ #
713
+ # source://dry-struct//lib/dry/struct/struct_builder.rb#52
714
+ def optional?(type); end
715
+
716
+ # source://dry-struct//lib/dry/struct/struct_builder.rb#54
717
+ def parent(type); end
718
+
719
+ # @return [Boolean]
720
+ #
721
+ # source://dry-struct//lib/dry/struct/struct_builder.rb#46
722
+ def type?(type); end
723
+
724
+ # source://dry-struct//lib/dry/struct/struct_builder.rb#89
725
+ def visit_array(node); end
726
+
727
+ # source://dry-struct//lib/dry/struct/struct_builder.rb#84
728
+ def visit_constrained(node); end
729
+
730
+ # source://dry-struct//lib/dry/struct/struct_builder.rb#96
731
+ def visit_constructor(node); end
732
+
733
+ # source://dry-struct//lib/dry/struct/struct_builder.rb#94
734
+ def visit_nominal(*_arg0); end
735
+ end
736
+
737
+ # A sum type of two or more structs
738
+ # As opposed to Dry::Types::Sum::Constrained
739
+ # this type tries no to coerce data first.
740
+ #
741
+ # source://dry-struct//lib/dry/struct/sum.rb#8
742
+ class Dry::Struct::Sum < ::Dry::Types::Sum::Constrained
743
+ # @return [boolean]
744
+ #
745
+ # source://dry-struct//lib/dry/struct/sum.rb#39
746
+ def ===(value); end
747
+
748
+ # source://dry-struct//lib/dry/struct/sum.rb#9
749
+ def call(input); end
750
+
751
+ # @param input [Hash{Symbol => Object}, Dry::Struct]
752
+ # @return [Dry::Types::Result]
753
+ # @yieldparam failure [Dry::Types::Result::Failure]
754
+ # @yieldreturn [Dry::Types::Result]
755
+ #
756
+ # source://dry-struct//lib/dry/struct/sum.rb#19
757
+ def try(input); end
758
+
759
+ # Build a new sum type
760
+ #
761
+ # @param type [Dry::Types::Type]
762
+ # @return [Dry::Types::Sum]
763
+ #
764
+ # source://dry-struct//lib/dry/struct/sum.rb#30
765
+ def |(type); end
766
+
767
+ protected
768
+
769
+ # @private
770
+ #
771
+ # source://dry-struct//lib/dry/struct/sum.rb#44
772
+ def try_struct(input, &block); end
773
+ end
774
+
775
+ # @private
776
+ #
777
+ # source://dry-struct//lib/dry/struct/version.rb#6
778
+ Dry::Struct::VERSION = T.let(T.unsafe(nil), String)
779
+
780
+ # {Value} objects behave like {Struct}s but *deeply frozen*
781
+ # using [`ice_nine`](https://github.com/dkubb/ice_nine)
782
+ #
783
+ # @example
784
+ # class Location < Dry::Struct::Value
785
+ # attribute :lat, Types::Float
786
+ # attribute :lng, Types::Float
787
+ # end
788
+ #
789
+ # loc1 = Location.new(lat: 1.23, lng: 4.56)
790
+ # loc2 = Location.new(lat: 1.23, lng: 4.56)
791
+ #
792
+ # loc1.frozen? #=> true
793
+ # loc2.frozen? #=> true
794
+ # loc1 == loc2 #=> true
795
+ # @see https://github.com/dkubb/ice_nine
796
+ #
797
+ # source://dry-struct//lib/dry/struct/value.rb#26
798
+ class Dry::Struct::Value < ::Dry::Struct
799
+ class << self
800
+ # @param attributes [Hash{Symbol => Object}, Dry::Struct]
801
+ # @return [Value]
802
+ # @see https://github.com/dkubb/ice_nine
803
+ #
804
+ # source://dry-struct//lib/dry/struct/value.rb#32
805
+ def new(*_arg0); end
806
+ end
807
+ end
808
+
809
+ # source://dry-struct//lib/dry/struct/printer.rb#6
810
+ module Dry::Types
811
+ extend ::Dry::Core::Constants
812
+
813
+ class << self
814
+ # source://dry-types/1.8.2/lib/dry/types/constraints.rb#13
815
+ def Rule(options); end
816
+
817
+ # source://dry-types/1.8.2/lib/dry/types.rb#115
818
+ def [](name); end
819
+
820
+ # source://dry-types/1.8.2/lib/dry/types.rb#163
821
+ def const_missing(const); end
822
+
823
+ # source://dry-types/1.8.2/lib/dry/types.rb#82
824
+ def container; end
825
+
826
+ # source://dry-types/1.8.2/lib/dry/types.rb#197
827
+ def define_builder(method, &block); end
828
+
829
+ # source://dry-types/1.8.2/lib/dry/types.rb#149
830
+ def identifier(klass); end
831
+
832
+ # source://dry-types/1.8.2/lib/dry/types.rb#73
833
+ def included(*_arg0); end
834
+
835
+ # source://dry-types/1.8.2/lib/dry/types.rb#33
836
+ def loader; end
837
+
838
+ # source://dry-core/1.1.0/lib/dry/core/deprecations.rb#202
839
+ def module(*args, &block); end
840
+
841
+ # source://dry-types/1.8.2/lib/dry/types.rb#104
842
+ def register(name, type = T.unsafe(nil), &block); end
843
+
844
+ # source://dry-types/1.8.2/lib/dry/types.rb#91
845
+ def registered?(class_or_identifier); end
846
+
847
+ # source://dry-types/1.8.2/lib/dry/types/constraints.rb#26
848
+ def rule_compiler; end
849
+
850
+ # source://dry-types/1.8.2/lib/dry/types.rb#158
851
+ def type_map; end
852
+ end
853
+ end
854
+
855
+ # @api private
856
+ #
857
+ # source://dry-struct//lib/dry/struct/printer.rb#8
858
+ class Dry::Types::Printer
859
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#38
860
+ def initialize; end
861
+
862
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#43
863
+ def call(type); end
864
+
865
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#49
866
+ def visit(type, &_arg1); end
867
+
868
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#62
869
+ def visit_any(_); end
870
+
871
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#64
872
+ def visit_array(type); end
873
+
874
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#70
875
+ def visit_array_member(array); end
876
+
877
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#152
878
+ def visit_callable(callable); end
879
+
880
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#102
881
+ def visit_composition(composition, &_arg1); end
882
+
883
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#91
884
+ def visit_constrained(constrained); end
885
+
886
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#78
887
+ def visit_constructor(constructor); end
888
+
889
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#126
890
+ def visit_default(default); end
891
+
892
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#108
893
+ def visit_enum(enum); end
894
+
895
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#250
896
+ def visit_hash(hash); end
897
+
898
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#240
899
+ def visit_key(key); end
900
+
901
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#146
902
+ def visit_lax(lax); end
903
+
904
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#226
905
+ def visit_map(map); end
906
+
907
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#140
908
+ def visit_nominal(type); end
909
+
910
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#269
911
+ def visit_options(options, meta = T.unsafe(nil)); end
912
+
913
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#187
914
+ def visit_schema(schema); end
915
+
916
+ # @api private
917
+ #
918
+ # source://dry-types/1.8.2/lib/dry/types/printer.rb#78
919
+ def visit_struct_constructor(constructor); end
920
+
921
+ # @api private
922
+ #
923
+ # source://dry-struct//lib/dry/struct/printer.rb#12
924
+ def visit_struct_sum(sum); end
925
+ end