smplkit 3.0.120 → 3.0.121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f21cdd3b499aaffa45dbf92b679ed06324dd8c7f07a3e43ff72e24702be9cc30
4
- data.tar.gz: 45a58c59df05b11c74a661f64c470e29aa7676d3e976107335d051384b8f6497
3
+ metadata.gz: 6f9ea84a0877be007a56f9f05502329795bb0d8f291cd0df226f2a1b96548980
4
+ data.tar.gz: d93a0cd1b4ae0b03032903a8a64743e8b31fca815a78ecdbc8bca5689be18e64
5
5
  SHA512:
6
- metadata.gz: 2aa8129c15ef6c1e687a36b3672118c84aada54a01632816fef22d297c55424a69b12ae34c9e93757ea3115099ac8871094e67981c25c709f4c25fbdd80c7df8
7
- data.tar.gz: c4d07ee7e073dd6d1387743aa1431dbcbc3e526c66055204f8059f8e6f3ec4433009666fea7c69ad91de1ce84c97bd34e66927b56b6b03119132c01bc57c29e3
6
+ metadata.gz: 43272f094727b6ecc958a8850582e775a9f0013b0572ff96718c53c26626662692f2f8c4896e1d643b70370bb926214f19cb5c8d714c67c4f9dcabb10cf2d265
7
+ data.tar.gz: 496db856f49fd0950584092683867bfb66f5d0c66eb28c8d3da7d8e8b7ae13f2524483f0a82af348403252123aa6714364b579d77495c9b3aab02721eaa1bdcb
@@ -31,8 +31,17 @@ module SmplkitGeneratedClient::Jobs
31
31
  # The ceiling on the wait between retries, in seconds, for `exponential` backoff — once the doubling reaches it, every subsequent retry waits this long. Only valid with `exponential` backoff; omit it for `fixed`.
32
32
  attr_accessor :max_delay_seconds
33
33
 
34
- # Which failures are retried. A run is retried only when its failure matches this set; an empty set retries nothing. Some failures are never retried regardless of this value.
35
- attr_accessor :retry_on
34
+ # Retry a run that failed because the request did not complete within the job's timeout. Defaults to `false` (timeouts are not retried).
35
+ attr_accessor :retry_on_timeout
36
+
37
+ # Retry a run that failed because the destination could not be reached (DNS, connection refused, TLS, or transport error). Defaults to `false` (connection errors are not retried).
38
+ attr_accessor :retry_on_connection_error
39
+
40
+ # Allowlist of response status patterns to retry when a run fails because the response did not match the job's success status. Each element is either an exact 3-digit HTTP code (e.g. `429`) or a status class (`1xx`, `2xx`, `3xx`, `4xx`, `5xx`) — for example `[\"429\", \"5xx\"]` to retry on rate-limit and any server error. Empty (the default) matches no status, so nothing is retried on a non-success response.
41
+ attr_accessor :retry_statuses
42
+
43
+ # Subtractions from `retry_statuses`, using the same exact-code or class syntax. A status that matches both lists is not retried — `except` wins on overlap — so `retry_statuses` of `[\"5xx\"]` with `retry_statuses_except` of `[\"501\"]` retries every server error except `501`. An element that does not overlap `retry_statuses` is allowed and simply has no effect. Empty (the default) subtracts nothing.
44
+ attr_accessor :retry_statuses_except
36
45
 
37
46
  # When the policy was created.
38
47
  attr_accessor :created_at
@@ -76,7 +85,10 @@ module SmplkitGeneratedClient::Jobs
76
85
  :'backoff' => :'backoff',
77
86
  :'delay_seconds' => :'delay_seconds',
78
87
  :'max_delay_seconds' => :'max_delay_seconds',
79
- :'retry_on' => :'retry_on',
88
+ :'retry_on_timeout' => :'retry_on_timeout',
89
+ :'retry_on_connection_error' => :'retry_on_connection_error',
90
+ :'retry_statuses' => :'retry_statuses',
91
+ :'retry_statuses_except' => :'retry_statuses_except',
80
92
  :'created_at' => :'created_at',
81
93
  :'updated_at' => :'updated_at',
82
94
  :'deleted_at' => :'deleted_at',
@@ -102,7 +114,10 @@ module SmplkitGeneratedClient::Jobs
102
114
  :'backoff' => :'String',
103
115
  :'delay_seconds' => :'Integer',
104
116
  :'max_delay_seconds' => :'Integer',
105
- :'retry_on' => :'RetryOn',
117
+ :'retry_on_timeout' => :'Boolean',
118
+ :'retry_on_connection_error' => :'Boolean',
119
+ :'retry_statuses' => :'Array<String>',
120
+ :'retry_statuses_except' => :'Array<String>',
106
121
  :'created_at' => :'Time',
107
122
  :'updated_at' => :'Time',
108
123
  :'deleted_at' => :'Time',
@@ -165,8 +180,28 @@ module SmplkitGeneratedClient::Jobs
165
180
  self.max_delay_seconds = attributes[:'max_delay_seconds']
166
181
  end
167
182
 
168
- if attributes.key?(:'retry_on')
169
- self.retry_on = attributes[:'retry_on']
183
+ if attributes.key?(:'retry_on_timeout')
184
+ self.retry_on_timeout = attributes[:'retry_on_timeout']
185
+ else
186
+ self.retry_on_timeout = false
187
+ end
188
+
189
+ if attributes.key?(:'retry_on_connection_error')
190
+ self.retry_on_connection_error = attributes[:'retry_on_connection_error']
191
+ else
192
+ self.retry_on_connection_error = false
193
+ end
194
+
195
+ if attributes.key?(:'retry_statuses')
196
+ if (value = attributes[:'retry_statuses']).is_a?(Array)
197
+ self.retry_statuses = value
198
+ end
199
+ end
200
+
201
+ if attributes.key?(:'retry_statuses_except')
202
+ if (value = attributes[:'retry_statuses_except']).is_a?(Array)
203
+ self.retry_statuses_except = value
204
+ end
170
205
  end
171
206
 
172
207
  if attributes.key?(:'created_at')
@@ -333,7 +368,10 @@ module SmplkitGeneratedClient::Jobs
333
368
  backoff == o.backoff &&
334
369
  delay_seconds == o.delay_seconds &&
335
370
  max_delay_seconds == o.max_delay_seconds &&
336
- retry_on == o.retry_on &&
371
+ retry_on_timeout == o.retry_on_timeout &&
372
+ retry_on_connection_error == o.retry_on_connection_error &&
373
+ retry_statuses == o.retry_statuses &&
374
+ retry_statuses_except == o.retry_statuses_except &&
337
375
  created_at == o.created_at &&
338
376
  updated_at == o.updated_at &&
339
377
  deleted_at == o.deleted_at &&
@@ -349,7 +387,7 @@ module SmplkitGeneratedClient::Jobs
349
387
  # Calculates hash code according to all attributes.
350
388
  # @return [Integer] Hash code
351
389
  def hash
352
- [name, max_retries, backoff, delay_seconds, max_delay_seconds, retry_on, created_at, updated_at, deleted_at, version].hash
390
+ [name, max_retries, backoff, delay_seconds, max_delay_seconds, retry_on_timeout, retry_on_connection_error, retry_statuses, retry_statuses_except, created_at, updated_at, deleted_at, version].hash
353
391
  end
354
392
 
355
393
  # Builds the object from hash
@@ -32,7 +32,6 @@ require 'smplkit_jobs_client/models/job_resource'
32
32
  require 'smplkit_jobs_client/models/job_response'
33
33
  require 'smplkit_jobs_client/models/list_meta'
34
34
  require 'smplkit_jobs_client/models/pagination_meta'
35
- require 'smplkit_jobs_client/models/retry_on'
36
35
  require 'smplkit_jobs_client/models/retry_policy'
37
36
  require 'smplkit_jobs_client/models/retry_policy_create_request'
38
37
  require 'smplkit_jobs_client/models/retry_policy_create_resource'
@@ -61,7 +61,25 @@ describe SmplkitGeneratedClient::Jobs::RetryPolicy do
61
61
  end
62
62
  end
63
63
 
64
- describe 'test attribute "retry_on"' do
64
+ describe 'test attribute "retry_on_timeout"' do
65
+ it 'should work' do
66
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
67
+ end
68
+ end
69
+
70
+ describe 'test attribute "retry_on_connection_error"' do
71
+ it 'should work' do
72
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
73
+ end
74
+ end
75
+
76
+ describe 'test attribute "retry_statuses"' do
77
+ it 'should work' do
78
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
79
+ end
80
+ end
81
+
82
+ describe 'test attribute "retry_statuses_except"' do
65
83
  it 'should work' do
66
84
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
67
85
  end
@@ -141,14 +141,28 @@ module Smplkit
141
141
  # @param max_delay_seconds [Integer, nil] Ceiling on the wait between
142
142
  # retries, for {Backoff::EXPONENTIAL} backoff only. +nil+ (the default)
143
143
  # leaves it uncapped; omit it for {Backoff::FIXED}.
144
- # @param retry_on [RetryOn, nil] Which failures to retry (see {RetryOn}).
145
- # +nil+ (the default) retries nothing.
144
+ # @param retry_on_timeout [Boolean] Retry a run that timed out. Defaults to
145
+ # +false+.
146
+ # @param retry_on_connection_error [Boolean] Retry a run whose destination
147
+ # could not be reached. Defaults to +false+.
148
+ # @param retry_statuses [Array<String>, nil] Allowlist of response-status
149
+ # patterns to retry on a non-success response. Each element is an exact
150
+ # 3-digit code (e.g. +"429"+) or a class token (+"1xx"+ … +"5xx"+).
151
+ # +nil+ (the default) retries no statuses.
152
+ # @param retry_statuses_except [Array<String>, nil] Patterns subtracted from
153
+ # +retry_statuses+, using the same syntax; +except+ wins on overlap.
154
+ # +nil+ (the default) subtracts nothing.
146
155
  # @return [Smplkit::Jobs::RetryPolicy]
147
- def new(id, name:, max_retries:, backoff:, delay_seconds:, max_delay_seconds: nil, retry_on: nil)
156
+ def new(id, name:, max_retries:, backoff:, delay_seconds:, max_delay_seconds: nil,
157
+ retry_on_timeout: false, retry_on_connection_error: false,
158
+ retry_statuses: nil, retry_statuses_except: nil)
148
159
  RetryPolicy.new(
149
160
  self,
150
161
  id: id, name: name, max_retries: max_retries, backoff: backoff,
151
- delay_seconds: delay_seconds, max_delay_seconds: max_delay_seconds, retry_on: retry_on
162
+ delay_seconds: delay_seconds, max_delay_seconds: max_delay_seconds,
163
+ retry_on_timeout: retry_on_timeout,
164
+ retry_on_connection_error: retry_on_connection_error,
165
+ retry_statuses: retry_statuses, retry_statuses_except: retry_statuses_except
152
166
  )
153
167
  end
154
168
 
@@ -214,8 +228,8 @@ module Smplkit
214
228
  private
215
229
 
216
230
  # Build the generated attributes model shared by create and update. The
217
- # +retry_on+ failure set is always sent; +max_delay_seconds+ is sent only
218
- # when present (omitting it leaves the policy uncapped / is invalid for
231
+ # four retry-condition fields are always sent; +max_delay_seconds+ is sent
232
+ # only when present (omitting it leaves the policy uncapped / is invalid for
219
233
  # fixed backoff).
220
234
  def build_retry_policy_attrs(policy)
221
235
  attrs = {
@@ -223,7 +237,10 @@ module Smplkit
223
237
  max_retries: policy.max_retries,
224
238
  backoff: policy.backoff,
225
239
  delay_seconds: policy.delay_seconds,
226
- retry_on: RetryOn.to_wire(policy.retry_on)
240
+ retry_on_timeout: policy.retry_on_timeout,
241
+ retry_on_connection_error: policy.retry_on_connection_error,
242
+ retry_statuses: Array(policy.retry_statuses).map(&:to_s),
243
+ retry_statuses_except: Array(policy.retry_statuses_except).map(&:to_s)
227
244
  }
228
245
  attrs[:max_delay_seconds] = policy.max_delay_seconds unless policy.max_delay_seconds.nil?
229
246
  SmplkitGeneratedClient::Jobs::RetryPolicy.new(attrs)
@@ -144,19 +144,6 @@ module Smplkit
144
144
  VALUES = [EXPONENTIAL, FIXED].freeze
145
145
  end
146
146
 
147
- # A failure category a retry policy can retry on.
148
- #
149
- # - +CONNECTION_ERROR+: The endpoint could not be reached.
150
- # - +NON_SUCCESS_STATUS+: Any non-success response, regardless of +statuses+.
151
- # - +TIMEOUT+: The run did not complete in time.
152
- module RetryReason
153
- CONNECTION_ERROR = "CONNECTION_ERROR"
154
- NON_SUCCESS_STATUS = "NON_SUCCESS_STATUS"
155
- TIMEOUT = "TIMEOUT"
156
-
157
- VALUES = [CONNECTION_ERROR, NON_SUCCESS_STATUS, TIMEOUT].freeze
158
- end
159
-
160
147
  # HTTP verb a job uses when it fires.
161
148
  #
162
149
  # Mirrors the jobs spec's method enum so a job's
@@ -187,46 +174,6 @@ module Smplkit
187
174
  end
188
175
  end
189
176
 
190
- # Which failures a retry policy retries. An empty {RetryOn} (both lists
191
- # empty) retries nothing.
192
- #
193
- # @!attribute [rw] statuses
194
- # @return [Array<Integer>] Response status codes to retry when a run fails
195
- # because the response did not match the job's success status (e.g.
196
- # +[429, 503]+ for rate-limit and unavailable). Each is a 3-digit HTTP
197
- # code. Defaults to an empty list.
198
- # @!attribute [rw] reasons
199
- # @return [Array<String>] Failure categories to retry — see {RetryReason}.
200
- # Defaults to an empty list.
201
- RetryOn = Struct.new(:statuses, :reasons, keyword_init: true) do
202
- def initialize(statuses: nil, reasons: nil)
203
- super(statuses: statuses || [], reasons: reasons || [])
204
- end
205
-
206
- # @api private — Convert a {RetryOn} into the generated wire model.
207
- # Reasons are serialized as their raw string values.
208
- #
209
- # @param src [RetryOn] The failure set to serialize.
210
- # @return [SmplkitGeneratedClient::Jobs::RetryOn] The wire model.
211
- def self.to_wire(src)
212
- SmplkitGeneratedClient::Jobs::RetryOn.new(
213
- statuses: Array(src.statuses),
214
- reasons: Array(src.reasons).map(&:to_s)
215
- )
216
- end
217
-
218
- # @api private — Build a {RetryOn} from the generated wire model. A +nil+
219
- # wire value (the field was absent) yields an empty {RetryOn}.
220
- #
221
- # @param src [SmplkitGeneratedClient::Jobs::RetryOn, nil] The wire model.
222
- # @return [RetryOn]
223
- def self.from_wire(src)
224
- return new if src.nil?
225
-
226
- new(statuses: src.statuses || [], reasons: src.reasons || [])
227
- end
228
- end
229
-
230
177
  # A single name/value HTTP header on the request a job performs.
231
178
  #
232
179
  # @!attribute [rw] name
@@ -1045,9 +992,23 @@ module Smplkit
1045
992
  # wire) leaves it uncapped; omit it for {Backoff::FIXED}.
1046
993
  attr_accessor :max_delay_seconds
1047
994
 
1048
- # @return [RetryOn] Which failures to retry; an empty {RetryOn} retries
1049
- # nothing. Defaults to empty.
1050
- attr_accessor :retry_on
995
+ # @return [Boolean] Retry a run that timed out. Defaults to +false+.
996
+ attr_accessor :retry_on_timeout
997
+
998
+ # @return [Boolean] Retry a run whose destination could not be reached (a
999
+ # connection error). Defaults to +false+.
1000
+ attr_accessor :retry_on_connection_error
1001
+
1002
+ # @return [Array<String>] Allowlist of response-status patterns to retry on
1003
+ # a non-success response. Each element is an exact 3-digit code (e.g.
1004
+ # +"429"+) or a class token (+"1xx"+ … +"5xx"+). Defaults to an empty
1005
+ # list (retries no statuses).
1006
+ attr_accessor :retry_statuses
1007
+
1008
+ # @return [Array<String>] Patterns subtracted from {#retry_statuses}, using
1009
+ # the same exact-code or class syntax. A status matching both lists is not
1010
+ # retried — +except+ wins on overlap. Defaults to an empty list.
1011
+ attr_accessor :retry_statuses_except
1051
1012
 
1052
1013
  # @return [String, nil] ISO-8601 timestamp of first persist. +nil+ for an
1053
1014
  # unsaved instance.
@@ -1065,7 +1026,9 @@ module Smplkit
1065
1026
  attr_accessor :version
1066
1027
 
1067
1028
  def initialize(client = nil, id:, name:, max_retries:, backoff:, delay_seconds:,
1068
- max_delay_seconds: nil, retry_on: nil, created_at: nil,
1029
+ max_delay_seconds: nil, retry_on_timeout: false,
1030
+ retry_on_connection_error: false, retry_statuses: nil,
1031
+ retry_statuses_except: nil, created_at: nil,
1069
1032
  updated_at: nil, deleted_at: nil, version: nil)
1070
1033
  @client = client
1071
1034
  @id = id
@@ -1074,7 +1037,10 @@ module Smplkit
1074
1037
  @backoff = backoff
1075
1038
  @delay_seconds = delay_seconds
1076
1039
  @max_delay_seconds = max_delay_seconds
1077
- @retry_on = retry_on || RetryOn.new
1040
+ @retry_on_timeout = retry_on_timeout
1041
+ @retry_on_connection_error = retry_on_connection_error
1042
+ @retry_statuses = retry_statuses || []
1043
+ @retry_statuses_except = retry_statuses_except || []
1078
1044
  @created_at = created_at
1079
1045
  @updated_at = updated_at
1080
1046
  @deleted_at = deleted_at
@@ -1115,7 +1081,10 @@ module Smplkit
1115
1081
  @backoff = other.backoff
1116
1082
  @delay_seconds = other.delay_seconds
1117
1083
  @max_delay_seconds = other.max_delay_seconds
1118
- @retry_on = other.retry_on
1084
+ @retry_on_timeout = other.retry_on_timeout
1085
+ @retry_on_connection_error = other.retry_on_connection_error
1086
+ @retry_statuses = other.retry_statuses
1087
+ @retry_statuses_except = other.retry_statuses_except
1119
1088
  @created_at = other.created_at
1120
1089
  @updated_at = other.updated_at
1121
1090
  @deleted_at = other.deleted_at
@@ -1138,7 +1107,10 @@ module Smplkit
1138
1107
  backoff: a.backoff,
1139
1108
  delay_seconds: a.delay_seconds,
1140
1109
  max_delay_seconds: a.max_delay_seconds,
1141
- retry_on: RetryOn.from_wire(a.retry_on),
1110
+ retry_on_timeout: a.retry_on_timeout || false,
1111
+ retry_on_connection_error: a.retry_on_connection_error || false,
1112
+ retry_statuses: a.retry_statuses || [],
1113
+ retry_statuses_except: a.retry_statuses_except || [],
1142
1114
  created_at: a.created_at,
1143
1115
  updated_at: a.updated_at,
1144
1116
  deleted_at: a.deleted_at,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smplkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.120
4
+ version: 3.0.121
5
5
  platform: ruby
6
6
  authors:
7
7
  - Smpl Solutions LLC
@@ -778,7 +778,6 @@ files:
778
778
  - lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_response.rb
779
779
  - lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/list_meta.rb
780
780
  - lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/pagination_meta.rb
781
- - lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/retry_on.rb
782
781
  - lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/retry_policy.rb
783
782
  - lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/retry_policy_create_request.rb
784
783
  - lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/retry_policy_create_resource.rb
@@ -815,7 +814,6 @@ files:
815
814
  - lib/smplkit/_generated/jobs/spec/models/job_spec.rb
816
815
  - lib/smplkit/_generated/jobs/spec/models/list_meta_spec.rb
817
816
  - lib/smplkit/_generated/jobs/spec/models/pagination_meta_spec.rb
818
- - lib/smplkit/_generated/jobs/spec/models/retry_on_spec.rb
819
817
  - lib/smplkit/_generated/jobs/spec/models/retry_policy_create_request_spec.rb
820
818
  - lib/smplkit/_generated/jobs/spec/models/retry_policy_create_resource_spec.rb
821
819
  - lib/smplkit/_generated/jobs/spec/models/retry_policy_list_response_spec.rb
@@ -1,185 +0,0 @@
1
- =begin
2
- #smplkit Jobs API
3
-
4
- #Scheduled HTTP job execution API for smplkit.
5
-
6
- The version of the OpenAPI document: 0.1.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.22.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module SmplkitGeneratedClient::Jobs
17
- # Which failures a policy retries. An empty policy (both lists empty or absent) retries nothing.
18
- class RetryOn < ApiModelBase
19
- # Response status codes that should be retried when a run fails because the response did not match the job's success status (for example `[429, 503]` to retry on rate-limit and unavailable). Each is a 3-digit HTTP status code. Empty matches no status.
20
- attr_accessor :statuses
21
-
22
- # Failure reasons that should be retried: `TIMEOUT` (the run did not complete in time), `CONNECTION_ERROR` (the endpoint could not be reached), or `NON_SUCCESS_STATUS` (any non-success response, regardless of `statuses`). Empty matches no reason.
23
- attr_accessor :reasons
24
-
25
- class EnumAttributeValidator
26
- attr_reader :datatype
27
- attr_reader :allowable_values
28
-
29
- def initialize(datatype, allowable_values)
30
- @allowable_values = allowable_values.map do |value|
31
- case datatype.to_s
32
- when /Integer/i
33
- value.to_i
34
- when /Float/i
35
- value.to_f
36
- else
37
- value
38
- end
39
- end
40
- end
41
-
42
- def valid?(value)
43
- !value || allowable_values.include?(value)
44
- end
45
- end
46
-
47
- # Attribute mapping from ruby-style variable name to JSON key.
48
- def self.attribute_map
49
- {
50
- :'statuses' => :'statuses',
51
- :'reasons' => :'reasons'
52
- }
53
- end
54
-
55
- # Returns attribute mapping this model knows about
56
- def self.acceptable_attribute_map
57
- attribute_map
58
- end
59
-
60
- # Returns all the JSON keys this model knows about
61
- def self.acceptable_attributes
62
- acceptable_attribute_map.values
63
- end
64
-
65
- # Attribute type mapping.
66
- def self.openapi_types
67
- {
68
- :'statuses' => :'Array<Integer>',
69
- :'reasons' => :'Array<String>'
70
- }
71
- end
72
-
73
- # List of attributes with nullable: true
74
- def self.openapi_nullable
75
- Set.new([
76
- ])
77
- end
78
-
79
- # Initializes the object
80
- # @param [Hash] attributes Model attributes in the form of hash
81
- def initialize(attributes = {})
82
- if (!attributes.is_a?(Hash))
83
- fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Jobs::RetryOn` initialize method"
84
- end
85
-
86
- # check to see if the attribute exists and convert string to symbol for hash key
87
- acceptable_attribute_map = self.class.acceptable_attribute_map
88
- attributes = attributes.each_with_object({}) { |(k, v), h|
89
- if (!acceptable_attribute_map.key?(k.to_sym))
90
- fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Jobs::RetryOn`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
91
- end
92
- h[k.to_sym] = v
93
- }
94
-
95
- if attributes.key?(:'statuses')
96
- if (value = attributes[:'statuses']).is_a?(Array)
97
- self.statuses = value
98
- end
99
- end
100
-
101
- if attributes.key?(:'reasons')
102
- if (value = attributes[:'reasons']).is_a?(Array)
103
- self.reasons = value
104
- end
105
- end
106
- end
107
-
108
- # Show invalid properties with the reasons. Usually used together with valid?
109
- # @return Array for valid properties with the reasons
110
- def list_invalid_properties
111
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
112
- invalid_properties = Array.new
113
- invalid_properties
114
- end
115
-
116
- # Check to see if the all the properties in the model are valid
117
- # @return true if the model is valid
118
- def valid?
119
- warn '[DEPRECATED] the `valid?` method is obsolete'
120
- true
121
- end
122
-
123
- # Checks equality by comparing each attribute.
124
- # @param [Object] Object to be compared
125
- def ==(o)
126
- return true if self.equal?(o)
127
- self.class == o.class &&
128
- statuses == o.statuses &&
129
- reasons == o.reasons
130
- end
131
-
132
- # @see the `==` method
133
- # @param [Object] Object to be compared
134
- def eql?(o)
135
- self == o
136
- end
137
-
138
- # Calculates hash code according to all attributes.
139
- # @return [Integer] Hash code
140
- def hash
141
- [statuses, reasons].hash
142
- end
143
-
144
- # Builds the object from hash
145
- # @param [Hash] attributes Model attributes in the form of hash
146
- # @return [Object] Returns the model itself
147
- def self.build_from_hash(attributes)
148
- return nil unless attributes.is_a?(Hash)
149
- attributes = attributes.transform_keys(&:to_sym)
150
- transformed_hash = {}
151
- openapi_types.each_pair do |key, type|
152
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
153
- transformed_hash["#{key}"] = nil
154
- elsif type =~ /\AArray<(.*)>/i
155
- # check to ensure the input is an array given that the attribute
156
- # is documented as an array but the input is not
157
- if attributes[attribute_map[key]].is_a?(Array)
158
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
159
- end
160
- elsif !attributes[attribute_map[key]].nil?
161
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
162
- end
163
- end
164
- new(transformed_hash)
165
- end
166
-
167
- # Returns the object in the form of hash
168
- # @return [Hash] Returns the object in the form of hash
169
- def to_hash
170
- hash = {}
171
- self.class.attribute_map.each_pair do |attr, param|
172
- value = self.send(attr)
173
- if value.nil?
174
- is_nullable = self.class.openapi_nullable.include?(attr)
175
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
176
- end
177
-
178
- hash[param] = _to_hash(value)
179
- end
180
- hash
181
- end
182
-
183
- end
184
-
185
- end
@@ -1,46 +0,0 @@
1
- =begin
2
- #smplkit Jobs API
3
-
4
- #Scheduled HTTP job execution API for smplkit.
5
-
6
- The version of the OpenAPI document: 0.1.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.22.0
10
-
11
- =end
12
-
13
- require 'spec_helper'
14
- require 'json'
15
- require 'date'
16
-
17
- # Unit tests for SmplkitGeneratedClient::Jobs::RetryOn
18
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
- # Please update as you see appropriate
20
- describe SmplkitGeneratedClient::Jobs::RetryOn do
21
- #let(:instance) { SmplkitGeneratedClient::Jobs::RetryOn.new }
22
-
23
- describe 'test an instance of RetryOn' do
24
- it 'should create an instance of RetryOn' do
25
- # uncomment below to test the instance creation
26
- #expect(instance).to be_instance_of(SmplkitGeneratedClient::Jobs::RetryOn)
27
- end
28
- end
29
-
30
- describe 'test attribute "statuses"' do
31
- it 'should work' do
32
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
- end
34
- end
35
-
36
- describe 'test attribute "reasons"' do
37
- it 'should work' do
38
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
- # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', ["TIMEOUT", "CONNECTION_ERROR", "NON_SUCCESS_STATUS"])
40
- # validator.allowable_values.each do |value|
41
- # expect { instance.reasons = value }.not_to raise_error
42
- # end
43
- end
44
- end
45
-
46
- end