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,176 @@
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 outcome for one URL.
8
+ class FetchResult < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The origin's declared media type for the main document, without
13
+ # parameters.
14
+ # Frequently unset, including on results that carry content. Never branch on
15
+ # it: `status` says whether a result carries content.
16
+ # @return [String]
17
+ attr_accessor :content_type
18
+
19
+ # The origin's declared media type for the main document, without
20
+ # parameters.
21
+ # Frequently unset, including on results that carry content. Never branch on
22
+ # it: `status` says whether a result carries content.
23
+ # @return [FetchError1]
24
+ attr_accessor :error
25
+
26
+ # The origin's declared media type for the main document, without
27
+ # parameters.
28
+ # Frequently unset, including on results that carry content. Never branch on
29
+ # it: `status` says whether a result carries content.
30
+ # @return [String]
31
+ attr_accessor :fetched_at
32
+
33
+ # The URL the content actually came from, after HTTP redirects and any
34
+ # client-side navigation. Equal to `requested_url` when nothing redirected.
35
+ # Set on a result whose `status` is ERROR only when the failure happened
36
+ # after the origin answered, such as a page this service could not extract.
37
+ # Unset when the URL was never reached.
38
+ # @return [String]
39
+ attr_accessor :final_url
40
+
41
+ # The origin's HTTP status code for the main document. Unset when no network
42
+ # response was observed for the navigation.
43
+ # An HTTP error status is not a fetch failure: this service renders the
44
+ # origin's error page, so a 404 arrives as an OK result carrying 404. On a
45
+ # result whose `status` is ERROR, this follows `final_url` - set only when
46
+ # the failure happened after the origin answered.
47
+ # @return [Integer]
48
+ attr_accessor :http_status_code
49
+
50
+ # The page's main content as Markdown, with boilerplate removed.
51
+ # @return [String]
52
+ attr_accessor :markdown
53
+
54
+ # The URL this answers, echoed verbatim from the request -- byte for byte,
55
+ # never normalized, and never the post-redirect URL. This is the correlation
56
+ # key. Where redirects landed is `final_url`.
57
+ # @return [String]
58
+ attr_accessor :requested_url
59
+
60
+ # The URL this answers, echoed verbatim from the request -- byte for byte,
61
+ # never normalized, and never the post-redirect URL. This is the correlation
62
+ # key. Where redirects landed is `final_url`.
63
+ # @return [FetchStatus2]
64
+ attr_accessor :status
65
+
66
+ # A mapping from model property names to API property names.
67
+ def self.names
68
+ @_hash = {} if @_hash.nil?
69
+ @_hash['content_type'] = 'content_type'
70
+ @_hash['error'] = 'error'
71
+ @_hash['fetched_at'] = 'fetched_at'
72
+ @_hash['final_url'] = 'final_url'
73
+ @_hash['http_status_code'] = 'http_status_code'
74
+ @_hash['markdown'] = 'markdown'
75
+ @_hash['requested_url'] = 'requested_url'
76
+ @_hash['status'] = 'status'
77
+ @_hash
78
+ end
79
+
80
+ # An array for optional fields
81
+ def self.optionals
82
+ %w[
83
+ content_type
84
+ error
85
+ fetched_at
86
+ final_url
87
+ http_status_code
88
+ markdown
89
+ requested_url
90
+ ]
91
+ end
92
+
93
+ # An array for nullable fields
94
+ def self.nullables
95
+ %w[
96
+ content_type
97
+ error
98
+ fetched_at
99
+ final_url
100
+ http_status_code
101
+ markdown
102
+ ]
103
+ end
104
+
105
+ def initialize(status: FetchStatus2::OK, content_type: SKIP, error: SKIP,
106
+ fetched_at: SKIP, final_url: SKIP, http_status_code: SKIP,
107
+ markdown: SKIP, requested_url: SKIP,
108
+ additional_properties: nil)
109
+ # Add additional model properties to the instance
110
+ additional_properties = {} if additional_properties.nil?
111
+
112
+ @content_type = content_type unless content_type == SKIP
113
+ @error = error unless error == SKIP
114
+ @fetched_at = fetched_at unless fetched_at == SKIP
115
+ @final_url = final_url unless final_url == SKIP
116
+ @http_status_code = http_status_code unless http_status_code == SKIP
117
+ @markdown = markdown unless markdown == SKIP
118
+ @requested_url = requested_url unless requested_url == SKIP
119
+ @status = status
120
+ @additional_properties = additional_properties
121
+ end
122
+
123
+ # Creates an instance of the object from a hash.
124
+ def self.from_hash(hash)
125
+ return nil unless hash
126
+
127
+ # Extract variables from the hash.
128
+ status = hash['status'] ||= FetchStatus2::OK
129
+ content_type = hash.key?('content_type') ? hash['content_type'] : SKIP
130
+ error = FetchError1.from_hash(hash['error']) if hash['error']
131
+ fetched_at = hash.key?('fetched_at') ? hash['fetched_at'] : SKIP
132
+ final_url = hash.key?('final_url') ? hash['final_url'] : SKIP
133
+ http_status_code =
134
+ hash.key?('http_status_code') ? hash['http_status_code'] : SKIP
135
+ markdown = hash.key?('markdown') ? hash['markdown'] : SKIP
136
+ requested_url = hash.key?('requested_url') ? hash['requested_url'] : SKIP
137
+
138
+ # Create a new hash for additional properties, removing known properties.
139
+ new_hash = hash.reject { |k, _| names.value?(k) }
140
+
141
+ additional_properties = APIHelper.get_additional_properties(
142
+ new_hash, proc { |value| value }
143
+ )
144
+
145
+ # Create object from extracted values.
146
+ FetchResult.new(status: status,
147
+ content_type: content_type,
148
+ error: error,
149
+ fetched_at: fetched_at,
150
+ final_url: final_url,
151
+ http_status_code: http_status_code,
152
+ markdown: markdown,
153
+ requested_url: requested_url,
154
+ additional_properties: additional_properties)
155
+ end
156
+
157
+ # Provides a human-readable string representation of the object.
158
+ def to_s
159
+ class_name = self.class.name.split('::').last
160
+ "<#{class_name} content_type: #{@content_type}, error: #{@error}, fetched_at:"\
161
+ " #{@fetched_at}, final_url: #{@final_url}, http_status_code: #{@http_status_code},"\
162
+ " markdown: #{@markdown}, requested_url: #{@requested_url}, status: #{@status},"\
163
+ " additional_properties: #{@additional_properties}>"
164
+ end
165
+
166
+ # Provides a debugging-friendly string with detailed object information.
167
+ def inspect
168
+ class_name = self.class.name.split('::').last
169
+ "<#{class_name} content_type: #{@content_type.inspect}, error: #{@error.inspect},"\
170
+ " fetched_at: #{@fetched_at.inspect}, final_url: #{@final_url.inspect}, http_status_code:"\
171
+ " #{@http_status_code.inspect}, markdown: #{@markdown.inspect}, requested_url:"\
172
+ " #{@requested_url.inspect}, status: #{@status.inspect}, additional_properties:"\
173
+ " #{@additional_properties}>"
174
+ end
175
+ end
176
+ end
@@ -0,0 +1,36 @@
1
+ # seltz_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SeltzApi
7
+ # Whether a `FetchResult` carries content.
8
+ class FetchStatus
9
+ FETCH_STATUS = [
10
+ # TODO: Write general description for OK
11
+ OK = 'ok'.freeze,
12
+
13
+ # TODO: Write general description for ERROR
14
+ ERROR = 'error'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ FETCH_STATUS.include?(value)
21
+ end
22
+
23
+ def self.from_value(value, default_value = OK)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'ok' then OK
30
+ when 'error' then ERROR
31
+ else
32
+ default_value
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,40 @@
1
+ # seltz_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SeltzApi
7
+ # Whether this result carries content. Branch on this field, never on whether
8
+ # a given content field is present: a format the page could not produce is
9
+ # unset on an otherwise successful result, so "markdown is absent" does not
10
+ # mean "the fetch failed". A failed fetch is still HTTP 200, with the error
11
+ # status on the result.
12
+ class FetchStatus2
13
+ FETCH_STATUS2 = [
14
+ # TODO: Write general description for OK
15
+ OK = 'ok'.freeze,
16
+
17
+ # TODO: Write general description for ERROR
18
+ ERROR = 'error'.freeze
19
+ ].freeze
20
+
21
+ def self.validate(value)
22
+ return false if value.nil?
23
+
24
+ FETCH_STATUS2.include?(value)
25
+ end
26
+
27
+ def self.from_value(value, default_value = OK)
28
+ return default_value if value.nil?
29
+
30
+ str = value.to_s.strip
31
+
32
+ case str.downcase
33
+ when 'ok' then OK
34
+ when 'error' then ERROR
35
+ else
36
+ default_value
37
+ end
38
+ end
39
+ end
40
+ 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
+ # The selectable members of a response `Document`, and how much of each to
8
+ # return. `Document.url` and `Document.published_date` are always selected.
9
+ # Each member takes `true`, `false`, or an object of ceilings. An object
10
+ # selects the member and bounds it, so `{"content":
11
+ # {"max_characters_per_result": 500}}` returns content and no snippets.
12
+ # `{"content": true}` selects content under the default ceiling, which is what
13
+ # `{"content": {}}` returns as well. `false` switches the member off. A
14
+ # `fields` that names neither member returns the defaults below, so `{}` and a
15
+ # wholly absent `fields` mean the same thing. A `fields` that names either is
16
+ # read literally, so `{"snippets": true}` returns passages and no content.
17
+ class Fields < BaseModel
18
+ SKIP = Object.new
19
+ private_constant :SKIP
20
+
21
+ # Emit `Document.content`. Unset is true.
22
+ # @return [Object]
23
+ attr_accessor :content
24
+
25
+ # Emit `Document.snippets`. Unset is false.
26
+ # @return [Object]
27
+ attr_accessor :snippets
28
+
29
+ # A mapping from model property names to API property names.
30
+ def self.names
31
+ @_hash = {} if @_hash.nil?
32
+ @_hash['content'] = 'content'
33
+ @_hash['snippets'] = 'snippets'
34
+ @_hash
35
+ end
36
+
37
+ # An array for optional fields
38
+ def self.optionals
39
+ %w[
40
+ content
41
+ snippets
42
+ ]
43
+ end
44
+
45
+ # An array for nullable fields
46
+ def self.nullables
47
+ []
48
+ end
49
+
50
+ def initialize(content: SKIP, snippets: SKIP, additional_properties: nil)
51
+ # Add additional model properties to the instance
52
+ additional_properties = {} if additional_properties.nil?
53
+
54
+ @content = content unless content == SKIP
55
+ @snippets = snippets unless snippets == SKIP
56
+ @additional_properties = additional_properties
57
+ end
58
+
59
+ # Creates an instance of the object from a hash.
60
+ def self.from_hash(hash)
61
+ return nil unless hash
62
+
63
+ # Extract variables from the hash.
64
+ content = hash.key?('content') ? APIHelper.deserialize_union_type(
65
+ UnionTypeLookUp.get(:FieldsContent), hash['content']
66
+ ) : SKIP
67
+ snippets = hash.key?('snippets') ? APIHelper.deserialize_union_type(
68
+ UnionTypeLookUp.get(:FieldsSnippets), hash['snippets']
69
+ ) : SKIP
70
+
71
+ # Create a new hash for additional properties, removing known properties.
72
+ new_hash = hash.reject { |k, _| names.value?(k) }
73
+
74
+ additional_properties = APIHelper.get_additional_properties(
75
+ new_hash, proc { |value| value }
76
+ )
77
+
78
+ # Create object from extracted values.
79
+ Fields.new(content: content,
80
+ snippets: snippets,
81
+ additional_properties: additional_properties)
82
+ end
83
+
84
+ # Validates an instance of the object from a given value.
85
+ # @param [Fields | Hash] The value against the validation is performed.
86
+ def self.validate(value)
87
+ return true if value.instance_of? self
88
+
89
+ return false unless value.instance_of? Hash
90
+
91
+ true
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} content: #{@content}, snippets: #{@snippets}, 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} content: #{@content.inspect}, snippets: #{@snippets.inspect},"\
105
+ " additional_properties: #{@additional_properties}>"
106
+ end
107
+ end
108
+ end
@@ -0,0 +1,101 @@
1
+ # seltz_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SeltzApi
7
+ # Which selectable members of `Document` to populate. If absent, defaults to
8
+ # `{content: true}`, which returns content under the default ceiling stated on
9
+ # `ContentOptions`.
10
+ class Fields2 < BaseModel
11
+ SKIP = Object.new
12
+ private_constant :SKIP
13
+
14
+ # Emit `Document.content`. Unset is true.
15
+ # @return [Object]
16
+ attr_accessor :content
17
+
18
+ # Emit `Document.snippets`. Unset is false.
19
+ # @return [Object]
20
+ attr_accessor :snippets
21
+
22
+ # A mapping from model property names to API property names.
23
+ def self.names
24
+ @_hash = {} if @_hash.nil?
25
+ @_hash['content'] = 'content'
26
+ @_hash['snippets'] = 'snippets'
27
+ @_hash
28
+ end
29
+
30
+ # An array for optional fields
31
+ def self.optionals
32
+ %w[
33
+ content
34
+ snippets
35
+ ]
36
+ end
37
+
38
+ # An array for nullable fields
39
+ def self.nullables
40
+ []
41
+ end
42
+
43
+ def initialize(content: SKIP, snippets: SKIP, additional_properties: nil)
44
+ # Add additional model properties to the instance
45
+ additional_properties = {} if additional_properties.nil?
46
+
47
+ @content = content unless content == SKIP
48
+ @snippets = snippets unless snippets == SKIP
49
+ @additional_properties = additional_properties
50
+ end
51
+
52
+ # Creates an instance of the object from a hash.
53
+ def self.from_hash(hash)
54
+ return nil unless hash
55
+
56
+ # Extract variables from the hash.
57
+ content = hash.key?('content') ? APIHelper.deserialize_union_type(
58
+ UnionTypeLookUp.get(:Fields2Content), hash['content']
59
+ ) : SKIP
60
+ snippets = hash.key?('snippets') ? APIHelper.deserialize_union_type(
61
+ UnionTypeLookUp.get(:Fields2Snippets), hash['snippets']
62
+ ) : SKIP
63
+
64
+ # Create a new hash for additional properties, removing known properties.
65
+ new_hash = hash.reject { |k, _| names.value?(k) }
66
+
67
+ additional_properties = APIHelper.get_additional_properties(
68
+ new_hash, proc { |value| value }
69
+ )
70
+
71
+ # Create object from extracted values.
72
+ Fields2.new(content: content,
73
+ snippets: snippets,
74
+ additional_properties: additional_properties)
75
+ end
76
+
77
+ # Validates an instance of the object from a given value.
78
+ # @param [Fields2 | Hash] The value against the validation is performed.
79
+ def self.validate(value)
80
+ return true if value.instance_of? self
81
+
82
+ return false unless value.instance_of? Hash
83
+
84
+ true
85
+ end
86
+
87
+ # Provides a human-readable string representation of the object.
88
+ def to_s
89
+ class_name = self.class.name.split('::').last
90
+ "<#{class_name} content: #{@content}, snippets: #{@snippets}, additional_properties:"\
91
+ " #{@additional_properties}>"
92
+ end
93
+
94
+ # Provides a debugging-friendly string with detailed object information.
95
+ def inspect
96
+ class_name = self.class.name.split('::').last
97
+ "<#{class_name} content: #{@content.inspect}, snippets: #{@snippets.inspect},"\
98
+ " additional_properties: #{@additional_properties}>"
99
+ end
100
+ end
101
+ 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
+ # GetMonitorResponse Model.
8
+ class GetMonitorResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [Monitor]
14
+ attr_accessor :monitor
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [RunState2]
18
+ attr_accessor :run_state
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['monitor'] = 'monitor'
24
+ @_hash['run_state'] = 'run_state'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ monitor
32
+ ]
33
+ end
34
+
35
+ # An array for nullable fields
36
+ def self.nullables
37
+ %w[
38
+ monitor
39
+ ]
40
+ end
41
+
42
+ def initialize(run_state: RunState2::IDLE, monitor: SKIP,
43
+ additional_properties: nil)
44
+ # Add additional model properties to the instance
45
+ additional_properties = {} if additional_properties.nil?
46
+
47
+ @monitor = monitor unless monitor == SKIP
48
+ @run_state = run_state
49
+ @additional_properties = additional_properties
50
+ end
51
+
52
+ # Creates an instance of the object from a hash.
53
+ def self.from_hash(hash)
54
+ return nil unless hash
55
+
56
+ # Extract variables from the hash.
57
+ run_state = hash['run_state'] ||= RunState2::IDLE
58
+ monitor = Monitor.from_hash(hash['monitor']) if hash['monitor']
59
+
60
+ # Create a new hash for additional properties, removing known properties.
61
+ new_hash = hash.reject { |k, _| names.value?(k) }
62
+
63
+ additional_properties = APIHelper.get_additional_properties(
64
+ new_hash, proc { |value| value }
65
+ )
66
+
67
+ # Create object from extracted values.
68
+ GetMonitorResponse.new(run_state: run_state,
69
+ monitor: monitor,
70
+ additional_properties: additional_properties)
71
+ end
72
+
73
+ # Provides a human-readable string representation of the object.
74
+ def to_s
75
+ class_name = self.class.name.split('::').last
76
+ "<#{class_name} monitor: #{@monitor}, run_state: #{@run_state}, additional_properties:"\
77
+ " #{@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} monitor: #{@monitor.inspect}, run_state: #{@run_state.inspect},"\
84
+ " additional_properties: #{@additional_properties}>"
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,76 @@
1
+ # seltz_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SeltzApi
7
+ # GetRunResponse Model.
8
+ class GetRunResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [Run]
14
+ attr_accessor :run
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['run'] = 'run'
20
+ @_hash
21
+ end
22
+
23
+ # An array for optional fields
24
+ def self.optionals
25
+ %w[
26
+ run
27
+ ]
28
+ end
29
+
30
+ # An array for nullable fields
31
+ def self.nullables
32
+ %w[
33
+ run
34
+ ]
35
+ end
36
+
37
+ def initialize(run: SKIP, additional_properties: nil)
38
+ # Add additional model properties to the instance
39
+ additional_properties = {} if additional_properties.nil?
40
+
41
+ @run = run unless run == SKIP
42
+ @additional_properties = additional_properties
43
+ end
44
+
45
+ # Creates an instance of the object from a hash.
46
+ def self.from_hash(hash)
47
+ return nil unless hash
48
+
49
+ # Extract variables from the hash.
50
+ run = Run.from_hash(hash['run']) if hash['run']
51
+
52
+ # Create a new hash for additional properties, removing known properties.
53
+ new_hash = hash.reject { |k, _| names.value?(k) }
54
+
55
+ additional_properties = APIHelper.get_additional_properties(
56
+ new_hash, proc { |value| value }
57
+ )
58
+
59
+ # Create object from extracted values.
60
+ GetRunResponse.new(run: run,
61
+ additional_properties: additional_properties)
62
+ end
63
+
64
+ # Provides a human-readable string representation of the object.
65
+ def to_s
66
+ class_name = self.class.name.split('::').last
67
+ "<#{class_name} run: #{@run}, additional_properties: #{@additional_properties}>"
68
+ end
69
+
70
+ # Provides a debugging-friendly string with detailed object information.
71
+ def inspect
72
+ class_name = self.class.name.split('::').last
73
+ "<#{class_name} run: #{@run.inspect}, additional_properties: #{@additional_properties}>"
74
+ end
75
+ end
76
+ end