smplkit 3.0.114 → 3.0.116

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: ac8fe2c97dbe9e809353ffa9240572f0b8121322dce79d599308dba14bf89654
4
- data.tar.gz: '04689fee543ee875c6d8b0ba68ed3cbd67242a490bee6ed3dafd5b33e030348e'
3
+ metadata.gz: bc58dc086c7fddd47a59bf3db2136dafb156549fe8d062957209ef0b0057b341
4
+ data.tar.gz: 422145f651bc3490f5210d436aee72682b40dc57407d3edd2c3ad65a80ff71db
5
5
  SHA512:
6
- metadata.gz: 1f26e6bec44ef6259a7d384ce5cd80c99eba77116a73bd22c3be814fcf683712a6a8b2fd1774e3a0e76cfe58bf28fc0184edcd91266ce3b453db60dd1a6e7fea
7
- data.tar.gz: bee0e18d7f5d8f4b9bbe64085da2782888ecd82fff072c92d4f81c4379c27f21dfc82643d26261d7a7c0af809b58d112239ae12e840c11b989331dd22317fd29
6
+ metadata.gz: 8bbddde3e3c7539bde483e6f0cf3faf9e9df1915560e8e42c107d53c0c79b035c971c4030daa301d9ed6b27ee78b834d445746113c5b227ffdd8389ddf4c1f49
7
+ data.tar.gz: ea6492fa6de7972f79ad7b56c84bcc53a6e7f157ce19c29d1e80087652eac775d3c028c171a50e4ce6afde8486cdf0abf86e958642b730a4286099d19ab7f674
@@ -25,13 +25,16 @@ module SmplkitGeneratedClient::Jobs
25
25
  # Job type. Only `http` is supported today.
26
26
  attr_accessor :type
27
27
 
28
- # The base schedule every environment inherits unless it overrides it, and the field that determines the job's `kind`. Omit it (or send `null`) to create a permanent **manual** job that never auto-fires and runs only when triggered. Provide a 5-field cron expression evaluated in **UTC** for a **recurring** job, an ISO-8601 datetime for a **one-off** run at that instant, or the literal `now` for a one-off run as soon as possible. A datetime or `now` job disables itself after it fires.
28
+ # The base schedule every environment inherits unless it overrides it, and the field that determines the job's `kind`. Omit it (or send `null`) to create a permanent **manual** job that never auto-fires and runs only when triggered. Provide a 5-field cron expression evaluated in the job's `timezone` (UTC by default) for a **recurring** job, an ISO-8601 datetime for a **one-off** run at that instant, or the literal `now` for a one-off run as soon as possible. A datetime or `now` job disables itself after it fires.
29
29
  attr_accessor :schedule
30
30
 
31
+ # IANA timezone the cron `schedule` is evaluated in (e.g. `America/New_York`); null or omitted means UTC. The base every environment inherits unless it sets its own `timezone`. The cron fires on this zone's wall clock (DST-aware) while `next_run_at` is still reported as a UTC instant. Only valid on a recurring (cron) job — it cannot be set on a manual or one-off job.
32
+ attr_accessor :timezone
33
+
31
34
  # The HTTP request to perform, including method, url, headers, body, and timeout.
32
35
  attr_accessor :configuration
33
36
 
34
- # Per-environment overrides keyed by environment key (e.g. `production`, `staging`). Each entry sets `enabled` (whether the job is enabled — scheduled, for a recurring job, or triggerable, for a manual job — in that environment), an optional `schedule` override (a cron expression for recurring jobs; omit to inherit the base `schedule`), and an optional `configuration` override (omit to inherit the base `configuration`); it also reports the read-only `next_run_at` for that environment. A job with no entry for an environment is disabled there. For a recurring or manual job, supply this map to choose where it runs. For a one-off job, the environment it is created in is recorded here automatically — name it with the `X-Smplkit-Environment` header. Every referenced environment must exist for the account.
37
+ # Per-environment overrides keyed by environment key (e.g. `production`, `staging`). Each entry sets `enabled` (whether the job is enabled — scheduled, for a recurring job, or triggerable, for a manual job — in that environment), an optional `schedule` override (a cron expression for recurring jobs; omit to inherit the base `schedule`), an optional `timezone` override (an IANA zone for recurring jobs; omit to inherit the base `timezone`, else UTC), and an optional `configuration` override (omit to inherit the base `configuration`); it also reports the read-only `next_run_at` for that environment. A job with no entry for an environment is disabled there. For a recurring or manual job, supply this map to choose where it runs. For a one-off job, the environment it is created in is recorded here automatically — name it with the `X-Smplkit-Environment` header. Every referenced environment must exist for the account.
35
38
  attr_accessor :environments
36
39
 
37
40
  # How overlapping runs are handled. `ALLOW` (the only value today) permits them.
@@ -81,6 +84,7 @@ module SmplkitGeneratedClient::Jobs
81
84
  :'description' => :'description',
82
85
  :'type' => :'type',
83
86
  :'schedule' => :'schedule',
87
+ :'timezone' => :'timezone',
84
88
  :'configuration' => :'configuration',
85
89
  :'environments' => :'environments',
86
90
  :'concurrency_policy' => :'concurrency_policy',
@@ -109,6 +113,7 @@ module SmplkitGeneratedClient::Jobs
109
113
  :'description' => :'String',
110
114
  :'type' => :'String',
111
115
  :'schedule' => :'String',
116
+ :'timezone' => :'String',
112
117
  :'configuration' => :'JobHttpConfiguration',
113
118
  :'environments' => :'Hash<String, JobEnvironment>',
114
119
  :'concurrency_policy' => :'String',
@@ -125,6 +130,7 @@ module SmplkitGeneratedClient::Jobs
125
130
  Set.new([
126
131
  :'description',
127
132
  :'schedule',
133
+ :'timezone',
128
134
  :'kind',
129
135
  :'created_at',
130
136
  :'updated_at',
@@ -169,6 +175,10 @@ module SmplkitGeneratedClient::Jobs
169
175
  self.schedule = attributes[:'schedule']
170
176
  end
171
177
 
178
+ if attributes.key?(:'timezone')
179
+ self.timezone = attributes[:'timezone']
180
+ end
181
+
172
182
  if attributes.key?(:'configuration')
173
183
  self.configuration = attributes[:'configuration']
174
184
  else
@@ -331,6 +341,7 @@ module SmplkitGeneratedClient::Jobs
331
341
  description == o.description &&
332
342
  type == o.type &&
333
343
  schedule == o.schedule &&
344
+ timezone == o.timezone &&
334
345
  configuration == o.configuration &&
335
346
  environments == o.environments &&
336
347
  concurrency_policy == o.concurrency_policy &&
@@ -350,7 +361,7 @@ module SmplkitGeneratedClient::Jobs
350
361
  # Calculates hash code according to all attributes.
351
362
  # @return [Integer] Hash code
352
363
  def hash
353
- [name, description, type, schedule, configuration, environments, concurrency_policy, kind, created_at, updated_at, deleted_at, version].hash
364
+ [name, description, type, schedule, timezone, configuration, environments, concurrency_policy, kind, created_at, updated_at, deleted_at, version].hash
354
365
  end
355
366
 
356
367
  # Builds the object from hash
@@ -19,9 +19,12 @@ module SmplkitGeneratedClient::Jobs
19
19
  # Whether the job schedules runs in this environment. A job runs in an environment only via this field; it is disabled in every environment by default.
20
20
  attr_accessor :enabled
21
21
 
22
- # Per-environment schedule override. Omit to inherit the job's base `schedule`. When present, it must be a 5-field cron expression evaluated in **UTC** (e.g. `0 3 * * *`), and is only allowed on a recurring (cron) job — it varies the cadence within that environment. It cannot appear on a manual or one-off job, and cannot change a job's kind.
22
+ # Per-environment schedule override. Omit to inherit the job's base `schedule`. When present, it must be a 5-field cron expression (e.g. `0 3 * * *`), evaluated in this environment's effective `timezone` (the per-environment override, else the base, else UTC), and is only allowed on a recurring (cron) job — it varies the cadence within that environment. It cannot appear on a manual or one-off job, and cannot change a job's kind.
23
23
  attr_accessor :schedule
24
24
 
25
+ # Per-environment timezone override for evaluating this environment's cron `schedule`. Omit to inherit the base `timezone` (else UTC). When present, it must be a valid IANA timezone key (e.g. `America/New_York`). Only valid on a recurring (cron) job; it may be set on an environment that inherits the base schedule (it need not also override `schedule`).
26
+ attr_accessor :timezone
27
+
25
28
  # Per-environment HTTP request override. Omit to inherit the job's base `configuration`. When present, it fully replaces the base configuration for runs in this environment.
26
29
  attr_accessor :configuration
27
30
 
@@ -33,6 +36,7 @@ module SmplkitGeneratedClient::Jobs
33
36
  {
34
37
  :'enabled' => :'enabled',
35
38
  :'schedule' => :'schedule',
39
+ :'timezone' => :'timezone',
36
40
  :'configuration' => :'configuration',
37
41
  :'next_run_at' => :'next_run_at'
38
42
  }
@@ -53,6 +57,7 @@ module SmplkitGeneratedClient::Jobs
53
57
  {
54
58
  :'enabled' => :'Boolean',
55
59
  :'schedule' => :'String',
60
+ :'timezone' => :'String',
56
61
  :'configuration' => :'JobHttpConfiguration',
57
62
  :'next_run_at' => :'Time'
58
63
  }
@@ -62,6 +67,7 @@ module SmplkitGeneratedClient::Jobs
62
67
  def self.openapi_nullable
63
68
  Set.new([
64
69
  :'schedule',
70
+ :'timezone',
65
71
  :'configuration',
66
72
  :'next_run_at'
67
73
  ])
@@ -93,6 +99,10 @@ module SmplkitGeneratedClient::Jobs
93
99
  self.schedule = attributes[:'schedule']
94
100
  end
95
101
 
102
+ if attributes.key?(:'timezone')
103
+ self.timezone = attributes[:'timezone']
104
+ end
105
+
96
106
  if attributes.key?(:'configuration')
97
107
  self.configuration = attributes[:'configuration']
98
108
  end
@@ -124,6 +134,7 @@ module SmplkitGeneratedClient::Jobs
124
134
  self.class == o.class &&
125
135
  enabled == o.enabled &&
126
136
  schedule == o.schedule &&
137
+ timezone == o.timezone &&
127
138
  configuration == o.configuration &&
128
139
  next_run_at == o.next_run_at
129
140
  end
@@ -137,7 +148,7 @@ module SmplkitGeneratedClient::Jobs
137
148
  # Calculates hash code according to all attributes.
138
149
  # @return [Integer] Hash code
139
150
  def hash
140
- [enabled, schedule, configuration, next_run_at].hash
151
+ [enabled, schedule, timezone, configuration, next_run_at].hash
141
152
  end
142
153
 
143
154
  # Builds the object from hash
@@ -39,6 +39,12 @@ describe SmplkitGeneratedClient::Jobs::JobEnvironment do
39
39
  end
40
40
  end
41
41
 
42
+ describe 'test attribute "timezone"' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ end
46
+ end
47
+
42
48
  describe 'test attribute "configuration"' do
43
49
  it 'should work' do
44
50
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -55,6 +55,12 @@ describe SmplkitGeneratedClient::Jobs::Job do
55
55
  end
56
56
  end
57
57
 
58
+ describe 'test attribute "timezone"' do
59
+ it 'should work' do
60
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
61
+ end
62
+ end
63
+
58
64
  describe 'test attribute "configuration"' do
59
65
  it 'should work' do
60
66
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -394,13 +394,15 @@ module Smplkit
394
394
  # Convert the wrapper +environments+ map to the generated model hash.
395
395
  #
396
396
  # Each entry's +enabled+ is always written; a per-environment +schedule+
397
- # (cron) override and +configuration+ override are each sent only when
398
- # present (omit to inherit the job's base +schedule+ / +configuration+).
399
- # The read-only per-environment +next_run_at+ is never written.
397
+ # (cron) override, +timezone+ override, and +configuration+ override are
398
+ # each sent only when present (omit to inherit the job's base +schedule+ /
399
+ # +timezone+ / +configuration+). The read-only per-environment
400
+ # +next_run_at+ is never written.
400
401
  def environments_to_wire(environments)
401
402
  (environments || {}).each_with_object({}) do |(env_key, env), out|
402
403
  attrs = { enabled: env.enabled }
403
404
  attrs[:schedule] = env.schedule unless env.schedule.nil?
405
+ attrs[:timezone] = env.timezone unless env.timezone.nil?
404
406
  attrs[:configuration] = HttpConfig.to_wire(env.configuration) unless env.configuration.nil?
405
407
  out[env_key.to_s] = SmplkitGeneratedClient::Jobs::JobEnvironment.new(attrs)
406
408
  end
@@ -418,6 +420,11 @@ module Smplkit
418
420
  configuration: HttpConfig.to_wire(job.configuration),
419
421
  concurrency_policy: job.concurrency_policy
420
422
  }
423
+ # +timezone+ is only valid on a recurring (cron) job; an unset +nil+ is
424
+ # omitted, leaving the server default of UTC. (Unlike +schedule+, whose
425
+ # explicit +null+ creates a manual job, omitting +timezone+ simply
426
+ # inherits UTC — so it is sent only when present.)
427
+ attrs[:timezone] = job.timezone unless job.timezone.nil?
421
428
  environments = job.environments
422
429
  attrs[:environments] = environments_to_wire(environments) unless environments.nil? || environments.empty?
423
430
  SmplkitGeneratedClient::Jobs::Job.new(attrs)
@@ -79,7 +79,8 @@ module Smplkit
79
79
  # (+{ enabled: true, schedule: "0 3 * * *", configuration: HttpConfig.new(...) }+)
80
80
  # so callers can use the lightweight hash form without importing the model. A
81
81
  # dict-form +configuration+ override is coerced to an {HttpConfig} so it
82
- # serializes on save; an optional +schedule+ cron override passes through.
82
+ # serializes on save; optional +schedule+ cron and +timezone+ overrides pass
83
+ # through.
83
84
  #
84
85
  # @api private
85
86
  def self.normalize_environments(environments)
@@ -94,6 +95,7 @@ module Smplkit
94
95
  JobEnvironment.new(
95
96
  enabled: value[:enabled] || value["enabled"] || false,
96
97
  schedule: value[:schedule] || value["schedule"],
98
+ timezone: value[:timezone] || value["timezone"],
97
99
  configuration: cfg
98
100
  )
99
101
  end
@@ -291,6 +293,13 @@ module Smplkit
291
293
  # inherits the job's base {Job#schedule}. When present, it must be a
292
294
  # 5-field UTC cron expression and is only meaningful on a recurring job —
293
295
  # it cannot turn a one-off job recurring or vice-versa.
296
+ # @!attribute [rw] timezone
297
+ # @return [String, nil] Optional per-environment IANA timezone override for
298
+ # evaluating this environment's cron {#schedule} (recurring jobs only).
299
+ # +nil+ (the default) inherits the base {Job#timezone}, else UTC. When
300
+ # present, it must be a valid IANA zone key (e.g. +"America/New_York"+);
301
+ # it may be set on an environment that inherits the base schedule (it
302
+ # need not also override {#schedule}). Sent on writes only when present.
294
303
  # @!attribute [rw] configuration
295
304
  # @return [HttpConfig, nil] Optional per-environment request configuration
296
305
  # that fully replaces the job's base {Job#configuration} for this
@@ -301,8 +310,8 @@ module Smplkit
301
310
  # @return [String, nil] Read-only. The next scheduled fire time in this
302
311
  # environment. +nil+ when the environment is not enabled, or once a
303
312
  # one-off run has fired. Never written back on save.
304
- JobEnvironment = Struct.new(:enabled, :schedule, :configuration, :next_run_at, keyword_init: true) do
305
- def initialize(enabled: false, schedule: nil, configuration: nil, next_run_at: nil)
313
+ JobEnvironment = Struct.new(:enabled, :schedule, :timezone, :configuration, :next_run_at, keyword_init: true) do
314
+ def initialize(enabled: false, schedule: nil, timezone: nil, configuration: nil, next_run_at: nil)
306
315
  super
307
316
  end
308
317
 
@@ -318,6 +327,7 @@ module Smplkit
318
327
  new(
319
328
  enabled: src.enabled.nil? ? false : src.enabled,
320
329
  schedule: src.schedule,
330
+ timezone: src.timezone,
321
331
  configuration: cfg.nil? ? nil : HttpConfig.from_wire(cfg),
322
332
  next_run_at: src.next_run_at
323
333
  )
@@ -386,6 +396,16 @@ module Smplkit
386
396
  # {#set_schedule}.
387
397
  attr_accessor :schedule
388
398
 
399
+ # @return [String, nil] The base IANA timezone the cron {#schedule} is
400
+ # evaluated in (e.g. +"America/New_York"+); +nil+ (the default) means
401
+ # UTC. The base every environment inherits unless it sets its own
402
+ # {JobEnvironment#timezone}. The cron fires on this zone's wall clock
403
+ # (DST-aware) while +next_run_at+ is still reported as a UTC instant.
404
+ # Only valid on a recurring (cron) job — leave +nil+ for a manual or
405
+ # one-off job. Set it with {#set_timezone}; sent on writes only when
406
+ # present.
407
+ attr_accessor :timezone
408
+
389
409
  # @return [HttpConfig] The base HTTP request to perform when the job fires.
390
410
  # Per-environment overrides live in {#environments}.
391
411
  attr_accessor :configuration
@@ -416,7 +436,7 @@ module Smplkit
416
436
  attr_accessor :birth_environment
417
437
 
418
438
  def initialize(client = nil, id:, name:, configuration:, schedule: nil,
419
- description: nil, environments: nil,
439
+ timezone: nil, description: nil, environments: nil,
420
440
  kind: nil, type: "http", concurrency_policy: "ALLOW",
421
441
  birth_environment: nil, created_at: nil,
422
442
  updated_at: nil, deleted_at: nil, version: nil)
@@ -428,6 +448,7 @@ module Smplkit
428
448
  @kind = kind
429
449
  @type = type
430
450
  @schedule = schedule
451
+ @timezone = timezone
431
452
  @configuration = configuration
432
453
  @concurrency_policy = concurrency_policy
433
454
  @birth_environment = birth_environment
@@ -580,6 +601,29 @@ module Smplkit
580
601
  end
581
602
  end
582
603
 
604
+ # Set the IANA timezone the cron schedule is evaluated in — base
605
+ # (+environment+ omitted) or per-environment.
606
+ #
607
+ # With +environment+ omitted (the default), sets the base {#timezone}
608
+ # every environment inherits unless it overrides it. With an +environment+
609
+ # given, sets that environment's per-environment +timezone+ override on
610
+ # {#environments}, creating the override entry if it doesn't exist yet
611
+ # (preserving any already-set +enabled+ / +schedule+ / +configuration+ on
612
+ # it). A timezone is only valid on a recurring (cron) job; +nil+ means UTC
613
+ # (base) or "inherit the base" (per-environment). Call {#save} to persist.
614
+ #
615
+ # @param timezone [String, nil] A valid IANA timezone key (e.g.
616
+ # +"America/New_York"+), or +nil+ for UTC / inherit.
617
+ # @param environment [String, nil] An environment key for a per-environment
618
+ # override, or +nil+ to set the base timezone.
619
+ def set_timezone(timezone, environment: nil)
620
+ if environment.nil?
621
+ @timezone = timezone
622
+ else
623
+ _environment_override(environment).timezone = timezone
624
+ end
625
+ end
626
+
583
627
  # Trigger one immediate, manual run of this job (a +MANUAL+ run).
584
628
  #
585
629
  # @param environment [String, nil] Environment the run executes in.
@@ -633,6 +677,7 @@ module Smplkit
633
677
  @kind = other.kind
634
678
  @type = other.type
635
679
  @schedule = other.schedule
680
+ @timezone = other.timezone
636
681
  @configuration = other.configuration
637
682
  @concurrency_policy = other.concurrency_policy
638
683
  @created_at = other.created_at
@@ -663,6 +708,7 @@ module Smplkit
663
708
  kind: a.kind,
664
709
  type: a.type || "http",
665
710
  schedule: a.schedule,
711
+ timezone: a.timezone,
666
712
  configuration: HttpConfig.from_wire(a.configuration),
667
713
  concurrency_policy: a.concurrency_policy || "ALLOW",
668
714
  created_at: a.created_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.114
4
+ version: 3.0.116
5
5
  platform: ruby
6
6
  authors:
7
7
  - Smpl Solutions LLC