sz-apimatic-sdk 0.0.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 (95) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +153 -0
  4. data/bin/console +15 -0
  5. data/lib/seltz_api/api_helper.rb +10 -0
  6. data/lib/seltz_api/apis/agent_api.rb +140 -0
  7. data/lib/seltz_api/apis/answer_api.rb +61 -0
  8. data/lib/seltz_api/apis/base_api.rb +67 -0
  9. data/lib/seltz_api/apis/fetch_api.rb +48 -0
  10. data/lib/seltz_api/apis/monitors_api.rb +161 -0
  11. data/lib/seltz_api/apis/records_api.rb +97 -0
  12. data/lib/seltz_api/apis/runs_api.rb +109 -0
  13. data/lib/seltz_api/apis/search_api.rb +55 -0
  14. data/lib/seltz_api/client.rb +111 -0
  15. data/lib/seltz_api/configuration.rb +165 -0
  16. data/lib/seltz_api/exceptions/api_exception.rb +21 -0
  17. data/lib/seltz_api/exceptions/error_envelope_exception.rb +46 -0
  18. data/lib/seltz_api/http/api_response.rb +19 -0
  19. data/lib/seltz_api/http/auth/custom_header_authentication.rb +52 -0
  20. data/lib/seltz_api/http/http_call_back.rb +10 -0
  21. data/lib/seltz_api/http/http_method_enum.rb +10 -0
  22. data/lib/seltz_api/http/http_request.rb +10 -0
  23. data/lib/seltz_api/http/http_response.rb +10 -0
  24. data/lib/seltz_api/http/proxy_settings.rb +22 -0
  25. data/lib/seltz_api/logging/configuration/api_logging_configuration.rb +186 -0
  26. data/lib/seltz_api/logging/sdk_logger.rb +17 -0
  27. data/lib/seltz_api/models/agent_run.rb +161 -0
  28. data/lib/seltz_api/models/agent_run_citation.rb +85 -0
  29. data/lib/seltz_api/models/agent_run_grounding.rb +94 -0
  30. data/lib/seltz_api/models/agent_run_output.rb +131 -0
  31. data/lib/seltz_api/models/agent_run_output2.rb +131 -0
  32. data/lib/seltz_api/models/agent_run_request.rb +100 -0
  33. data/lib/seltz_api/models/agent_run_request2.rb +100 -0
  34. data/lib/seltz_api/models/agent_run_source.rb +86 -0
  35. data/lib/seltz_api/models/agent_run_status.rb +49 -0
  36. data/lib/seltz_api/models/agent_run_status2.rb +48 -0
  37. data/lib/seltz_api/models/agent_run_stop_reason.rb +53 -0
  38. data/lib/seltz_api/models/agent_run_stop_reason2.rb +52 -0
  39. data/lib/seltz_api/models/answer_http_request.rb +172 -0
  40. data/lib/seltz_api/models/answer_http_response.rb +93 -0
  41. data/lib/seltz_api/models/base_model.rb +110 -0
  42. data/lib/seltz_api/models/content_options.rb +99 -0
  43. data/lib/seltz_api/models/create_agent_run_request.rb +104 -0
  44. data/lib/seltz_api/models/create_monitor_request.rb +143 -0
  45. data/lib/seltz_api/models/create_monitor_response.rb +90 -0
  46. data/lib/seltz_api/models/document.rb +128 -0
  47. data/lib/seltz_api/models/envelope_error.rb +83 -0
  48. data/lib/seltz_api/models/envelope_error1.rb +82 -0
  49. data/lib/seltz_api/models/fetch_error.rb +107 -0
  50. data/lib/seltz_api/models/fetch_error1.rb +108 -0
  51. data/lib/seltz_api/models/fetch_request.rb +144 -0
  52. data/lib/seltz_api/models/fetch_response.rb +87 -0
  53. data/lib/seltz_api/models/fetch_result.rb +176 -0
  54. data/lib/seltz_api/models/fetch_status.rb +36 -0
  55. data/lib/seltz_api/models/fetch_status2.rb +40 -0
  56. data/lib/seltz_api/models/fields.rb +108 -0
  57. data/lib/seltz_api/models/fields2.rb +101 -0
  58. data/lib/seltz_api/models/get_monitor_response.rb +87 -0
  59. data/lib/seltz_api/models/get_run_response.rb +76 -0
  60. data/lib/seltz_api/models/http_citation.rb +86 -0
  61. data/lib/seltz_api/models/list_agent_runs_response.rb +96 -0
  62. data/lib/seltz_api/models/list_monitors_response.rb +97 -0
  63. data/lib/seltz_api/models/list_records_response.rb +96 -0
  64. data/lib/seltz_api/models/list_run_records_response.rb +96 -0
  65. data/lib/seltz_api/models/list_run_requests_response.rb +84 -0
  66. data/lib/seltz_api/models/list_runs_response.rb +96 -0
  67. data/lib/seltz_api/models/monitor.rb +157 -0
  68. data/lib/seltz_api/models/monitor_search_request.rb +110 -0
  69. data/lib/seltz_api/models/monitor_status.rb +47 -0
  70. data/lib/seltz_api/models/monitor_status2.rb +45 -0
  71. data/lib/seltz_api/models/payload.rb +74 -0
  72. data/lib/seltz_api/models/record.rb +116 -0
  73. data/lib/seltz_api/models/record_type.rb +26 -0
  74. data/lib/seltz_api/models/request_status.rb +36 -0
  75. data/lib/seltz_api/models/run.rb +200 -0
  76. data/lib/seltz_api/models/run_request.rb +127 -0
  77. data/lib/seltz_api/models/run_state.rb +40 -0
  78. data/lib/seltz_api/models/run_state2.rb +41 -0
  79. data/lib/seltz_api/models/run_status.rb +47 -0
  80. data/lib/seltz_api/models/schedule.rb +73 -0
  81. data/lib/seltz_api/models/search_record.rb +101 -0
  82. data/lib/seltz_api/models/search_request.rb +208 -0
  83. data/lib/seltz_api/models/search_request_ref.rb +87 -0
  84. data/lib/seltz_api/models/search_response.rb +85 -0
  85. data/lib/seltz_api/models/snippet.rb +76 -0
  86. data/lib/seltz_api/models/snippet_options.rb +151 -0
  87. data/lib/seltz_api/models/update_monitor_request.rb +153 -0
  88. data/lib/seltz_api/models/update_monitor_response.rb +77 -0
  89. data/lib/seltz_api/models/webhook.rb +113 -0
  90. data/lib/seltz_api/models/webhook1.rb +114 -0
  91. data/lib/seltz_api/utilities/date_time_helper.rb +11 -0
  92. data/lib/seltz_api/utilities/file_wrapper.rb +28 -0
  93. data/lib/seltz_api/utilities/union_type_lookup.rb +62 -0
  94. data/lib/seltz_api.rb +115 -0
  95. metadata +178 -0
@@ -0,0 +1,83 @@
1
+ # seltz_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SeltzApi
7
+ # The error context. `code` is a stable descriptor in all-caps from a closed
8
+ # set per endpoint. `message` is a human-readable summary of what went wrong.
9
+ class EnvelopeError < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # The error code.
14
+ # @return [String]
15
+ attr_accessor :code
16
+
17
+ # The error message.
18
+ # @return [String]
19
+ attr_accessor :message
20
+
21
+ # A mapping from model property names to API property names.
22
+ def self.names
23
+ @_hash = {} if @_hash.nil?
24
+ @_hash['code'] = 'code'
25
+ @_hash['message'] = 'message'
26
+ @_hash
27
+ end
28
+
29
+ # An array for optional fields
30
+ def self.optionals
31
+ []
32
+ end
33
+
34
+ # An array for nullable fields
35
+ def self.nullables
36
+ []
37
+ end
38
+
39
+ def initialize(code:, message:, additional_properties: nil)
40
+ # Add additional model properties to the instance
41
+ additional_properties = {} if additional_properties.nil?
42
+
43
+ @code = code
44
+ @message = message
45
+ @additional_properties = additional_properties
46
+ end
47
+
48
+ # Creates an instance of the object from a hash.
49
+ def self.from_hash(hash)
50
+ return nil unless hash
51
+
52
+ # Extract variables from the hash.
53
+ code = hash.key?('code') ? hash['code'] : nil
54
+ message = hash.key?('message') ? hash['message'] : nil
55
+
56
+ # Create a new hash for additional properties, removing known properties.
57
+ new_hash = hash.reject { |k, _| names.value?(k) }
58
+
59
+ additional_properties = APIHelper.get_additional_properties(
60
+ new_hash, proc { |value| value }
61
+ )
62
+
63
+ # Create object from extracted values.
64
+ EnvelopeError.new(code: code,
65
+ message: message,
66
+ additional_properties: additional_properties)
67
+ end
68
+
69
+ # Provides a human-readable string representation of the object.
70
+ def to_s
71
+ class_name = self.class.name.split('::').last
72
+ "<#{class_name} code: #{@code}, message: #{@message}, additional_properties:"\
73
+ " #{@additional_properties}>"
74
+ end
75
+
76
+ # Provides a debugging-friendly string with detailed object information.
77
+ def inspect
78
+ class_name = self.class.name.split('::').last
79
+ "<#{class_name} code: #{@code.inspect}, message: #{@message.inspect},"\
80
+ " additional_properties: #{@additional_properties}>"
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,82 @@
1
+ # seltz_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SeltzApi
7
+ # The error context.
8
+ class EnvelopeError1 < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The error code.
13
+ # @return [String]
14
+ attr_accessor :code
15
+
16
+ # The error message.
17
+ # @return [String]
18
+ attr_accessor :message
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['code'] = 'code'
24
+ @_hash['message'] = 'message'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ []
31
+ end
32
+
33
+ # An array for nullable fields
34
+ def self.nullables
35
+ []
36
+ end
37
+
38
+ def initialize(code:, message:, additional_properties: nil)
39
+ # Add additional model properties to the instance
40
+ additional_properties = {} if additional_properties.nil?
41
+
42
+ @code = code
43
+ @message = message
44
+ @additional_properties = additional_properties
45
+ end
46
+
47
+ # Creates an instance of the object from a hash.
48
+ def self.from_hash(hash)
49
+ return nil unless hash
50
+
51
+ # Extract variables from the hash.
52
+ code = hash.key?('code') ? hash['code'] : nil
53
+ message = hash.key?('message') ? hash['message'] : nil
54
+
55
+ # Create a new hash for additional properties, removing known properties.
56
+ new_hash = hash.reject { |k, _| names.value?(k) }
57
+
58
+ additional_properties = APIHelper.get_additional_properties(
59
+ new_hash, proc { |value| value }
60
+ )
61
+
62
+ # Create object from extracted values.
63
+ EnvelopeError1.new(code: code,
64
+ message: message,
65
+ additional_properties: additional_properties)
66
+ end
67
+
68
+ # Provides a human-readable string representation of the object.
69
+ def to_s
70
+ class_name = self.class.name.split('::').last
71
+ "<#{class_name} code: #{@code}, message: #{@message}, additional_properties:"\
72
+ " #{@additional_properties}>"
73
+ end
74
+
75
+ # Provides a debugging-friendly string with detailed object information.
76
+ def inspect
77
+ class_name = self.class.name.split('::').last
78
+ "<#{class_name} code: #{@code.inspect}, message: #{@message.inspect},"\
79
+ " additional_properties: #{@additional_properties}>"
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,107 @@
1
+ # seltz_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SeltzApi
7
+ # Why one URL failed.
8
+ class FetchError < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # A stable, machine-readable reason. A client must treat an unrecognized
13
+ # code as a generic failure rather than rejecting the result.
14
+ # Documented codes:
15
+ # "invalid_url" -- not a parseable absolute URL.
16
+ # "unsupported_scheme" -- parseable, but not `http` or `https`.
17
+ # "url_not_accessible" -- DNS, connection, TLS, or navigation
18
+ # failure reaching the origin, or a host
19
+ # this service does not fetch.
20
+ # "timeout" -- the fetch did not finish within
21
+ # `timeout_ms`.
22
+ # "unsupported_content_type" -- the document is not an HTML page. PDFs,
23
+ # images, archives, and other binaries are
24
+ # out of scope. Refused from the URL before
25
+ # the fetch, or from the media type the
26
+ # origin declared after it.
27
+ # "extraction_failed" -- the page was fetched, but no requested
28
+ # format could be produced from it.
29
+ # "upstream_error" -- the fetch path itself failed. Ours, not
30
+ # the URL's.
31
+ # @return [String]
32
+ attr_accessor :code
33
+
34
+ # A human-readable explanation. Always set when this message is present:
35
+ # `FetchError` itself is optional on the result, so an absent error is
36
+ # absent whole, and there is no state where a failure arrives without a
37
+ # reason. For operators and logs. Never parse it -- branch on `code`. The
38
+ # wording of any given message may change at any time.
39
+ # @return [String]
40
+ attr_accessor :message
41
+
42
+ # A mapping from model property names to API property names.
43
+ def self.names
44
+ @_hash = {} if @_hash.nil?
45
+ @_hash['code'] = 'code'
46
+ @_hash['message'] = 'message'
47
+ @_hash
48
+ end
49
+
50
+ # An array for optional fields
51
+ def self.optionals
52
+ %w[
53
+ code
54
+ message
55
+ ]
56
+ end
57
+
58
+ # An array for nullable fields
59
+ def self.nullables
60
+ []
61
+ end
62
+
63
+ def initialize(code: SKIP, message: SKIP, additional_properties: nil)
64
+ # Add additional model properties to the instance
65
+ additional_properties = {} if additional_properties.nil?
66
+
67
+ @code = code unless code == SKIP
68
+ @message = message unless message == SKIP
69
+ @additional_properties = additional_properties
70
+ end
71
+
72
+ # Creates an instance of the object from a hash.
73
+ def self.from_hash(hash)
74
+ return nil unless hash
75
+
76
+ # Extract variables from the hash.
77
+ code = hash.key?('code') ? hash['code'] : SKIP
78
+ message = hash.key?('message') ? hash['message'] : SKIP
79
+
80
+ # Create a new hash for additional properties, removing known properties.
81
+ new_hash = hash.reject { |k, _| names.value?(k) }
82
+
83
+ additional_properties = APIHelper.get_additional_properties(
84
+ new_hash, proc { |value| value }
85
+ )
86
+
87
+ # Create object from extracted values.
88
+ FetchError.new(code: code,
89
+ message: message,
90
+ additional_properties: additional_properties)
91
+ end
92
+
93
+ # Provides a human-readable string representation of the object.
94
+ def to_s
95
+ class_name = self.class.name.split('::').last
96
+ "<#{class_name} code: #{@code}, message: #{@message}, additional_properties:"\
97
+ " #{@additional_properties}>"
98
+ end
99
+
100
+ # Provides a debugging-friendly string with detailed object information.
101
+ def inspect
102
+ class_name = self.class.name.split('::').last
103
+ "<#{class_name} code: #{@code.inspect}, message: #{@message.inspect},"\
104
+ " additional_properties: #{@additional_properties}>"
105
+ end
106
+ end
107
+ end
@@ -0,0 +1,108 @@
1
+ # seltz_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SeltzApi
7
+ # Why the fetch failed. Set when `status` is the error status, unset
8
+ # otherwise.
9
+ class FetchError1 < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # A stable, machine-readable reason. A client must treat an unrecognized
14
+ # code as a generic failure rather than rejecting the result.
15
+ # Documented codes:
16
+ # "invalid_url" -- not a parseable absolute URL.
17
+ # "unsupported_scheme" -- parseable, but not `http` or `https`.
18
+ # "url_not_accessible" -- DNS, connection, TLS, or navigation
19
+ # failure reaching the origin, or a host
20
+ # this service does not fetch.
21
+ # "timeout" -- the fetch did not finish within
22
+ # `timeout_ms`.
23
+ # "unsupported_content_type" -- the document is not an HTML page. PDFs,
24
+ # images, archives, and other binaries are
25
+ # out of scope. Refused from the URL before
26
+ # the fetch, or from the media type the
27
+ # origin declared after it.
28
+ # "extraction_failed" -- the page was fetched, but no requested
29
+ # format could be produced from it.
30
+ # "upstream_error" -- the fetch path itself failed. Ours, not
31
+ # the URL's.
32
+ # @return [String]
33
+ attr_accessor :code
34
+
35
+ # A human-readable explanation. Always set when this message is present:
36
+ # `FetchError` itself is optional on the result, so an absent error is
37
+ # absent whole, and there is no state where a failure arrives without a
38
+ # reason. For operators and logs. Never parse it -- branch on `code`. The
39
+ # wording of any given message may change at any time.
40
+ # @return [String]
41
+ attr_accessor :message
42
+
43
+ # A mapping from model property names to API property names.
44
+ def self.names
45
+ @_hash = {} if @_hash.nil?
46
+ @_hash['code'] = 'code'
47
+ @_hash['message'] = 'message'
48
+ @_hash
49
+ end
50
+
51
+ # An array for optional fields
52
+ def self.optionals
53
+ %w[
54
+ code
55
+ message
56
+ ]
57
+ end
58
+
59
+ # An array for nullable fields
60
+ def self.nullables
61
+ []
62
+ end
63
+
64
+ def initialize(code: SKIP, message: SKIP, additional_properties: nil)
65
+ # Add additional model properties to the instance
66
+ additional_properties = {} if additional_properties.nil?
67
+
68
+ @code = code unless code == SKIP
69
+ @message = message unless message == SKIP
70
+ @additional_properties = additional_properties
71
+ end
72
+
73
+ # Creates an instance of the object from a hash.
74
+ def self.from_hash(hash)
75
+ return nil unless hash
76
+
77
+ # Extract variables from the hash.
78
+ code = hash.key?('code') ? hash['code'] : SKIP
79
+ message = hash.key?('message') ? hash['message'] : SKIP
80
+
81
+ # Create a new hash for additional properties, removing known properties.
82
+ new_hash = hash.reject { |k, _| names.value?(k) }
83
+
84
+ additional_properties = APIHelper.get_additional_properties(
85
+ new_hash, proc { |value| value }
86
+ )
87
+
88
+ # Create object from extracted values.
89
+ FetchError1.new(code: code,
90
+ message: message,
91
+ additional_properties: additional_properties)
92
+ end
93
+
94
+ # Provides a human-readable string representation of the object.
95
+ def to_s
96
+ class_name = self.class.name.split('::').last
97
+ "<#{class_name} code: #{@code}, message: #{@message}, additional_properties:"\
98
+ " #{@additional_properties}>"
99
+ end
100
+
101
+ # Provides a debugging-friendly string with detailed object information.
102
+ def inspect
103
+ class_name = self.class.name.split('::').last
104
+ "<#{class_name} code: #{@code.inspect}, message: #{@message.inspect},"\
105
+ " additional_properties: #{@additional_properties}>"
106
+ end
107
+ end
108
+ end
@@ -0,0 +1,144 @@
1
+ # seltz_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SeltzApi
7
+ # FetchRequest Model.
8
+ class FetchRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # API key to access the service. Either this or the `x-api-key` header must
13
+ # be supplied on the HTTP surface; the header takes precedence and is the
14
+ # documented path. On gRPC this field is the only carrier.
15
+ # Each URL that comes back with the OK status is billed. A URL that comes
16
+ # back with an error is not. The call is refused up front unless the balance
17
+ # covers the whole batch.
18
+ # @return [String]
19
+ attr_accessor :api_key
20
+
21
+ # Representations to return, as documented format names.
22
+ # Omitted, or sent empty, means `\["markdown"\]` -- a repeated field carries
23
+ # no presence, so the two are the same request and neither means "no
24
+ # formats".
25
+ # Documented names:
26
+ # "markdown" -- the main content as Markdown, boilerplate removed.
27
+ # An unrecognized name is rejected.
28
+ # @return [Array[String]]
29
+ attr_accessor :formats
30
+
31
+ # The service tier, which selects the price. Send `"pro"`. Unset resolves to
32
+ # `"pro"`.
33
+ # An unrecognized value is rejected rather than defaulted, because the value
34
+ # selects a price. The name is matched exactly.
35
+ # @return [String]
36
+ attr_accessor :tier
37
+
38
+ # Wall-clock budget for one URL, in milliseconds.
39
+ # Applies to each URL, not to the batch. A URL that exceeds the budget gets
40
+ # `error.code = "timeout"`; the others in the same request are unaffected.
41
+ # Unset means 75000, which is also the maximum; a larger value is served as
42
+ # 75000, and a value below 1000 is served as 1000.
43
+ # @return [Integer]
44
+ attr_accessor :timeout_ms
45
+
46
+ # The URLs to fetch. At least one, at most 20.
47
+ # An empty list, more than 20 entries, a duplicate entry, a blank or padded
48
+ # entry, or an entry over 2048 bytes is rejected before any billing --
49
+ # duplicates because `FetchResult.requested_url` is the correlation key and
50
+ # a repeated key is ambiguous.
51
+ # Everything else is reported inside a `200` as that URL's error result: a
52
+ # value that is not an absolute `http` or `https` URL, a host that does not
53
+ # resolve or that this service will not fetch, an origin that refuses, and a
54
+ # document that is not an HTML page.
55
+ # @return [Array[String]]
56
+ attr_accessor :urls
57
+
58
+ # A mapping from model property names to API property names.
59
+ def self.names
60
+ @_hash = {} if @_hash.nil?
61
+ @_hash['api_key'] = 'api_key'
62
+ @_hash['formats'] = 'formats'
63
+ @_hash['tier'] = 'tier'
64
+ @_hash['timeout_ms'] = 'timeout_ms'
65
+ @_hash['urls'] = 'urls'
66
+ @_hash
67
+ end
68
+
69
+ # An array for optional fields
70
+ def self.optionals
71
+ %w[
72
+ api_key
73
+ formats
74
+ tier
75
+ timeout_ms
76
+ urls
77
+ ]
78
+ end
79
+
80
+ # An array for nullable fields
81
+ def self.nullables
82
+ %w[
83
+ api_key
84
+ tier
85
+ timeout_ms
86
+ ]
87
+ end
88
+
89
+ def initialize(api_key: SKIP, formats:, tier: SKIP, timeout_ms: SKIP, urls:,
90
+ additional_properties: nil)
91
+ # Add additional model properties to the instance
92
+ additional_properties = {} if additional_properties.nil?
93
+
94
+ @api_key = api_key unless api_key == SKIP
95
+ @formats = formats unless formats == SKIP
96
+ @tier = tier unless tier == SKIP
97
+ @timeout_ms = timeout_ms unless timeout_ms == SKIP
98
+ @urls = urls unless urls == SKIP
99
+ @additional_properties = additional_properties
100
+ end
101
+
102
+ # Creates an instance of the object from a hash.
103
+ def self.from_hash(hash)
104
+ return nil unless hash
105
+
106
+ # Extract variables from the hash.
107
+ api_key = hash.key?('api_key') ? hash['api_key'] : SKIP
108
+ formats = hash['formats'] ||=
109
+ tier = hash.key?('tier') ? hash['tier'] : SKIP
110
+ timeout_ms = hash.key?('timeout_ms') ? hash['timeout_ms'] : SKIP
111
+ urls = hash['urls'] ||=
112
+
113
+ # Create a new hash for additional properties, removing known properties.
114
+ new_hash = hash.reject { |k, _| names.value?(k) }
115
+
116
+ additional_properties = APIHelper.get_additional_properties(
117
+ new_hash, proc { |value| value }
118
+ )
119
+
120
+ # Create object from extracted values.
121
+ FetchRequest.new(api_key: api_key,
122
+ formats: formats,
123
+ tier: tier,
124
+ timeout_ms: timeout_ms,
125
+ urls: urls,
126
+ additional_properties: additional_properties)
127
+ end
128
+
129
+ # Provides a human-readable string representation of the object.
130
+ def to_s
131
+ class_name = self.class.name.split('::').last
132
+ "<#{class_name} api_key: #{@api_key}, formats: #{@formats}, tier: #{@tier}, timeout_ms:"\
133
+ " #{@timeout_ms}, urls: #{@urls}, additional_properties: #{@additional_properties}>"
134
+ end
135
+
136
+ # Provides a debugging-friendly string with detailed object information.
137
+ def inspect
138
+ class_name = self.class.name.split('::').last
139
+ "<#{class_name} api_key: #{@api_key.inspect}, formats: #{@formats.inspect}, tier:"\
140
+ " #{@tier.inspect}, timeout_ms: #{@timeout_ms.inspect}, urls: #{@urls.inspect},"\
141
+ " additional_properties: #{@additional_properties}>"
142
+ end
143
+ end
144
+ end
@@ -0,0 +1,87 @@
1
+ # seltz_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SeltzApi
7
+ # One result per requested URL.
8
+ class FetchResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # One entry per entry in `FetchRequest.urls`, successful or not, in the
13
+ # order
14
+ # the URLs were requested.
15
+ # Correlate on `FetchResult.requested_url` rather than on position.
16
+ # @return [Array[FetchResult]]
17
+ attr_accessor :results
18
+
19
+ # A mapping from model property names to API property names.
20
+ def self.names
21
+ @_hash = {} if @_hash.nil?
22
+ @_hash['results'] = 'results'
23
+ @_hash
24
+ end
25
+
26
+ # An array for optional fields
27
+ def self.optionals
28
+ %w[
29
+ results
30
+ ]
31
+ end
32
+
33
+ # An array for nullable fields
34
+ def self.nullables
35
+ []
36
+ end
37
+
38
+ def initialize(results: SKIP, additional_properties: nil)
39
+ # Add additional model properties to the instance
40
+ additional_properties = {} if additional_properties.nil?
41
+
42
+ @results = results unless results == SKIP
43
+ @additional_properties = additional_properties
44
+ end
45
+
46
+ # Creates an instance of the object from a hash.
47
+ def self.from_hash(hash)
48
+ return nil unless hash
49
+
50
+ # Extract variables from the hash.
51
+ # Parameter is an array, so we need to iterate through it
52
+ results = nil
53
+ unless hash['results'].nil?
54
+ results = []
55
+ hash['results'].each do |structure|
56
+ results << (FetchResult.from_hash(structure) if structure)
57
+ end
58
+ end
59
+
60
+ results = SKIP unless hash.key?('results')
61
+
62
+ # Create a new hash for additional properties, removing known properties.
63
+ new_hash = hash.reject { |k, _| names.value?(k) }
64
+
65
+ additional_properties = APIHelper.get_additional_properties(
66
+ new_hash, proc { |value| value }
67
+ )
68
+
69
+ # Create object from extracted values.
70
+ FetchResponse.new(results: results,
71
+ additional_properties: additional_properties)
72
+ end
73
+
74
+ # Provides a human-readable string representation of the object.
75
+ def to_s
76
+ class_name = self.class.name.split('::').last
77
+ "<#{class_name} results: #{@results}, additional_properties: #{@additional_properties}>"
78
+ end
79
+
80
+ # Provides a debugging-friendly string with detailed object information.
81
+ def inspect
82
+ class_name = self.class.name.split('::').last
83
+ "<#{class_name} results: #{@results.inspect}, additional_properties:"\
84
+ " #{@additional_properties}>"
85
+ end
86
+ end
87
+ end