infisical-sdk 2.3.9 → 3.0.0

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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +37 -0
  4. data/.ruby-version +1 -0
  5. data/.yardopts +5 -0
  6. data/LICENSE +201 -0
  7. data/README.md +134 -0
  8. data/Rakefile +5 -5
  9. data/infisical-sdk.gemspec +21 -38
  10. data/lib/infisical/auth.rb +50 -0
  11. data/lib/infisical/client.rb +67 -0
  12. data/lib/infisical/errors.rb +82 -0
  13. data/lib/infisical/http_client.rb +212 -0
  14. data/lib/infisical/models/machine_identity_credential.rb +34 -0
  15. data/lib/infisical/models/secret.rb +93 -0
  16. data/lib/infisical/secrets.rb +213 -0
  17. data/lib/infisical/version.rb +6 -0
  18. data/lib/infisical-sdk.rb +3 -43
  19. data/lib/infisical.rb +9 -0
  20. metadata +35 -124
  21. data/Steepfile +0 -46
  22. data/lib/clients/auth.rb +0 -100
  23. data/lib/clients/cryptography.rb +0 -90
  24. data/lib/clients/secrets.rb +0 -171
  25. data/lib/command_runner.rb +0 -16
  26. data/lib/extended_schemas/schemas.rb +0 -38
  27. data/lib/infisical_error.rb +0 -10
  28. data/lib/infisical_lib.rb +0 -44
  29. data/lib/linux-arm64/libinfisical_c.so +0 -0
  30. data/lib/linux-x64/libinfisical_c.so +0 -0
  31. data/lib/macos-arm64/libinfisical_c.dylib +0 -0
  32. data/lib/macos-x64/libinfisical_c.dylib +0 -0
  33. data/lib/schemas.rb +0 -1674
  34. data/lib/version.rb +0 -5
  35. data/lib/windows-x64/infisical_c.dll +0 -0
  36. data/sig/infisical_sdk/auth_client.rbs +0 -20
  37. data/sig/infisical_sdk/command_runner.rbs +0 -10
  38. data/sig/infisical_sdk/cryptography_client.rbs +0 -15
  39. data/sig/infisical_sdk/infisical_client.rbs +0 -30
  40. data/sig/infisical_sdk/infisical_lib.rbs +0 -7
  41. data/sig/infisical_sdk/sdk.rbs +0 -3
  42. data/sig/infisical_sdk/secrets_client.rbs +0 -56
  43. data/sig/infisical_sdk/structs.rbs +0 -37
data/lib/schemas.rb DELETED
@@ -1,1674 +0,0 @@
1
- # This code may look unusually verbose for Ruby (and it is), but
2
- # it performs some subtle and complex validation of JSON data.
3
- #
4
- # To parse this JSON, add 'dry-struct' and 'dry-types' gems, then do:
5
- #
6
- # client_settings = ClientSettings.from_json! "{…}"
7
- # puts client_settings.auth&.access_token.nil?
8
- #
9
- # command_list = CommandList.from_json! "{…}"
10
- # puts command_list.aws_iam_auth_login&.identity_id
11
- #
12
- # api_result_for_access_token_success_response = APIResultForAccessTokenSuccessResponse.from_json! "{…}"
13
- # puts api_result_for_access_token_success_response.data&.access_token
14
- #
15
- # api_result_for_create_secret_response = APIResultForCreateSecretResponse.from_json! "{…}"
16
- # puts api_result_for_create_secret_response.data&.secret.environment
17
- #
18
- # api_result_for_create_symmetric_key_response = APIResultForCreateSymmetricKeyResponse.from_json! "{…}"
19
- # puts api_result_for_create_symmetric_key_response.data&.key
20
- #
21
- # api_result_for_decrypt_symmetric_response = APIResultForDecryptSymmetricResponse.from_json! "{…}"
22
- # puts api_result_for_decrypt_symmetric_response.data&.decrypted
23
- #
24
- # api_result_for_delete_secret_response = APIResultForDeleteSecretResponse.from_json! "{…}"
25
- # puts api_result_for_delete_secret_response.data&.secret.environment
26
- #
27
- # api_result_for_encrypt_symmetric_response = APIResultForEncryptSymmetricResponse.from_json! "{…}"
28
- # puts api_result_for_encrypt_symmetric_response.data&.ciphertext
29
- #
30
- # api_result_for_get_secret_response = APIResultForGetSecretResponse.from_json! "{…}"
31
- # puts api_result_for_get_secret_response.data&.secret.environment
32
- #
33
- # api_result_for_list_secrets_response = APIResultForListSecretsResponse.from_json! "{…}"
34
- # puts api_result_for_list_secrets_response.data&.secrets.first.environment
35
- #
36
- # api_result_for_update_secret_response = APIResultForUpdateSecretResponse.from_json! "{…}"
37
- # puts api_result_for_update_secret_response.data&.secret.environment
38
- #
39
- # If from_json! succeeds, the value returned matches the schema.
40
-
41
- require 'json'
42
- require 'dry-types'
43
- require 'dry-struct'
44
-
45
- module Types
46
- include Dry.Types(default: :nominal)
47
-
48
- Integer = Strict::Integer
49
- Nil = Strict::Nil
50
- Bool = Strict::Bool
51
- Hash = Strict::Hash
52
- String = Strict::String
53
- end
54
-
55
- class AWSIamAuthMethod < Dry::Struct
56
-
57
- # The Infisical Identity ID that you want to authenticate to Infisical with.
58
- attribute :identity_id, Types::String
59
-
60
- def self.from_dynamic!(d)
61
- d = Types::Hash[d]
62
- new(
63
- identity_id: d.fetch("identityId"),
64
- )
65
- end
66
-
67
- def self.from_json!(json)
68
- from_dynamic!(JSON.parse(json))
69
- end
70
-
71
- def to_dynamic
72
- {
73
- "identityId" => identity_id,
74
- }
75
- end
76
-
77
- def to_json(options = nil)
78
- JSON.generate(to_dynamic, options)
79
- end
80
- end
81
-
82
- class AzureAuthMethod < Dry::Struct
83
-
84
- # The Infisical Identity ID that you want to authenticate to Infisical with.
85
- attribute :identity_id, Types::String
86
-
87
- def self.from_dynamic!(d)
88
- d = Types::Hash[d]
89
- new(
90
- identity_id: d.fetch("identityId"),
91
- )
92
- end
93
-
94
- def self.from_json!(json)
95
- from_dynamic!(JSON.parse(json))
96
- end
97
-
98
- def to_dynamic
99
- {
100
- "identityId" => identity_id,
101
- }
102
- end
103
-
104
- def to_json(options = nil)
105
- JSON.generate(to_dynamic, options)
106
- end
107
- end
108
-
109
- class GCPIamAuthMethod < Dry::Struct
110
- attribute :identity_id, Types::String
111
-
112
- # The path to the GCP Service Account key file.
113
- #
114
- # You can generate this key file by going to the GCP Console -> IAM & Admin -> Service
115
- # Accounts -> *Select your service account* -> Keys tab -> Add key.
116
- # Note: The key must be in JSON format.
117
- attribute :service_account_key_file_path, Types::String
118
-
119
- def self.from_dynamic!(d)
120
- d = Types::Hash[d]
121
- new(
122
- identity_id: d.fetch("identityId"),
123
- service_account_key_file_path: d.fetch("serviceAccountKeyFilePath"),
124
- )
125
- end
126
-
127
- def self.from_json!(json)
128
- from_dynamic!(JSON.parse(json))
129
- end
130
-
131
- def to_dynamic
132
- {
133
- "identityId" => identity_id,
134
- "serviceAccountKeyFilePath" => service_account_key_file_path,
135
- }
136
- end
137
-
138
- def to_json(options = nil)
139
- JSON.generate(to_dynamic, options)
140
- end
141
- end
142
-
143
- class GCPIDTokenAuthMethod < Dry::Struct
144
- attribute :identity_id, Types::String
145
-
146
- def self.from_dynamic!(d)
147
- d = Types::Hash[d]
148
- new(
149
- identity_id: d.fetch("identityId"),
150
- )
151
- end
152
-
153
- def self.from_json!(json)
154
- from_dynamic!(JSON.parse(json))
155
- end
156
-
157
- def to_dynamic
158
- {
159
- "identityId" => identity_id,
160
- }
161
- end
162
-
163
- def to_json(options = nil)
164
- JSON.generate(to_dynamic, options)
165
- end
166
- end
167
-
168
- class KubernetesAuthMethod < Dry::Struct
169
-
170
- # The Infisical Identity ID that you want to authenticate to Infisical with.
171
- attribute :identity_id, Types::String
172
-
173
- # The path to the Kubernetes Service Account token file.
174
- #
175
- # If no path is provided, it will default to
176
- # /var/run/secrets/kubernetes.io/serviceaccount/token.
177
- attribute :service_account_token_path, Types::String.optional.optional
178
-
179
- def self.from_dynamic!(d)
180
- d = Types::Hash[d]
181
- new(
182
- identity_id: d.fetch("identityId"),
183
- service_account_token_path: d["serviceAccountTokenPath"],
184
- )
185
- end
186
-
187
- def self.from_json!(json)
188
- from_dynamic!(JSON.parse(json))
189
- end
190
-
191
- def to_dynamic
192
- {
193
- "identityId" => identity_id,
194
- "serviceAccountTokenPath" => service_account_token_path,
195
- }
196
- end
197
-
198
- def to_json(options = nil)
199
- JSON.generate(to_dynamic, options)
200
- end
201
- end
202
-
203
- class UniversalAuthMethod < Dry::Struct
204
- attribute :client_id, Types::String
205
- attribute :client_secret, Types::String
206
-
207
- def self.from_dynamic!(d)
208
- d = Types::Hash[d]
209
- new(
210
- client_id: d.fetch("clientId"),
211
- client_secret: d.fetch("clientSecret"),
212
- )
213
- end
214
-
215
- def self.from_json!(json)
216
- from_dynamic!(JSON.parse(json))
217
- end
218
-
219
- def to_dynamic
220
- {
221
- "clientId" => client_id,
222
- "clientSecret" => client_secret,
223
- }
224
- end
225
-
226
- def to_json(options = nil)
227
- JSON.generate(to_dynamic, options)
228
- end
229
- end
230
-
231
- # Configure the authentication method to use.
232
- #
233
- # Make sure to only set one one method at a time to avoid conflicts and unexpected behavior.
234
- class AuthenticationOptions < Dry::Struct
235
- attribute :access_token, Types::String.optional.optional
236
- attribute :aws_iam, AWSIamAuthMethod.optional.optional
237
- attribute :azure, AzureAuthMethod.optional.optional
238
- attribute :gcp_iam, GCPIamAuthMethod.optional.optional
239
- attribute :gcp_id_token, GCPIDTokenAuthMethod.optional.optional
240
- attribute :kubernetes, KubernetesAuthMethod.optional.optional
241
- attribute :universal_auth, UniversalAuthMethod.optional.optional
242
-
243
- def self.from_dynamic!(d)
244
- d = Types::Hash[d]
245
- new(
246
- access_token: d["accessToken"],
247
- aws_iam: d["awsIam"] ? AWSIamAuthMethod.from_dynamic!(d["awsIam"]) : nil,
248
- azure: d["azure"] ? AzureAuthMethod.from_dynamic!(d["azure"]) : nil,
249
- gcp_iam: d["gcpIam"] ? GCPIamAuthMethod.from_dynamic!(d["gcpIam"]) : nil,
250
- gcp_id_token: d["gcpIdToken"] ? GCPIDTokenAuthMethod.from_dynamic!(d["gcpIdToken"]) : nil,
251
- kubernetes: d["kubernetes"] ? KubernetesAuthMethod.from_dynamic!(d["kubernetes"]) : nil,
252
- universal_auth: d["universalAuth"] ? UniversalAuthMethod.from_dynamic!(d["universalAuth"]) : nil,
253
- )
254
- end
255
-
256
- def self.from_json!(json)
257
- from_dynamic!(JSON.parse(json))
258
- end
259
-
260
- def to_dynamic
261
- {
262
- "accessToken" => access_token,
263
- "awsIam" => aws_iam&.to_dynamic,
264
- "azure" => azure&.to_dynamic,
265
- "gcpIam" => gcp_iam&.to_dynamic,
266
- "gcpIdToken" => gcp_id_token&.to_dynamic,
267
- "kubernetes" => kubernetes&.to_dynamic,
268
- "universalAuth" => universal_auth&.to_dynamic,
269
- }
270
- end
271
-
272
- def to_json(options = nil)
273
- JSON.generate(to_dynamic, options)
274
- end
275
- end
276
-
277
- class ClientSettings < Dry::Struct
278
-
279
- # **DEPRECATED**: The access token field is deprecated. Please use the new auth object
280
- # field instead.
281
- attribute :access_token, Types::String.optional.optional
282
-
283
- # Configure the authentication method to use.
284
- #
285
- # Make sure to only set one one method at a time to avoid conflicts and unexpected behavior.
286
- attribute :auth, AuthenticationOptions.optional
287
-
288
- # cacheTTL controls how often the cache should refresh, default is 300 seconds. Set to 0 to
289
- # disable the cache.
290
- attribute :cache_ttl, Types::Integer.optional.optional
291
-
292
- # **DEPRECATED**: The client secret field is deprecated. Please use the new auth object
293
- # field instead.
294
- attribute :client_id, Types::String.optional.optional
295
-
296
- # **DEPRECATED**: The client secret field is deprecated. Please use the new auth object
297
- # field instead.
298
- attribute :client_secret, Types::String.optional.optional
299
-
300
- # The URL of the site to connect to. Defaults to "https://app.infisical.com".
301
- attribute :site_url, Types::String.optional.optional
302
-
303
- # The SSL certificate path is an optional field that allows you to specify a custom SSL
304
- # certificate to use for requests made to Infisical.
305
- # This option can be substituted with the `INFISICAL_SSL_CERTIFICATE` environment variable,
306
- # which should contain the certificate as a string, not the path.
307
- attribute :ssl_certificate_path, Types::String.optional.optional
308
-
309
- attribute :user_agent, Types::String.optional.optional
310
-
311
- def self.from_dynamic!(d)
312
- d = Types::Hash[d]
313
- new(
314
- access_token: d["accessToken"],
315
- auth: d["auth"] ? AuthenticationOptions.from_dynamic!(d["auth"]) : nil,
316
- cache_ttl: d["cacheTtl"],
317
- client_id: d["clientId"],
318
- client_secret: d["clientSecret"],
319
- site_url: d["siteUrl"],
320
- ssl_certificate_path: d["sslCertificatePath"],
321
- user_agent: d["userAgent"],
322
- )
323
- end
324
-
325
- def self.from_json!(json)
326
- from_dynamic!(JSON.parse(json))
327
- end
328
-
329
- def to_dynamic
330
- {
331
- "accessToken" => access_token,
332
- "auth" => auth&.to_dynamic,
333
- "cacheTtl" => cache_ttl,
334
- "clientId" => client_id,
335
- "clientSecret" => client_secret,
336
- "siteUrl" => site_url,
337
- "sslCertificatePath" => ssl_certificate_path,
338
- "userAgent" => user_agent,
339
- }
340
- end
341
-
342
- def to_json(options = nil)
343
- JSON.generate(to_dynamic, options)
344
- end
345
- end
346
-
347
- class AwsIamAuthLoginClass < Dry::Struct
348
-
349
- # The Infisical Identity ID that you want to authenticate to Infisical with.
350
- attribute :identity_id, Types::String
351
-
352
- def self.from_dynamic!(d)
353
- d = Types::Hash[d]
354
- new(
355
- identity_id: d.fetch("identityId"),
356
- )
357
- end
358
-
359
- def self.from_json!(json)
360
- from_dynamic!(JSON.parse(json))
361
- end
362
-
363
- def to_dynamic
364
- {
365
- "identityId" => identity_id,
366
- }
367
- end
368
-
369
- def to_json(options = nil)
370
- JSON.generate(to_dynamic, options)
371
- end
372
- end
373
-
374
- class AzureAuthLoginClass < Dry::Struct
375
-
376
- # The Infisical Identity ID that you want to authenticate to Infisical with.
377
- attribute :identity_id, Types::String
378
-
379
- def self.from_dynamic!(d)
380
- d = Types::Hash[d]
381
- new(
382
- identity_id: d.fetch("identityId"),
383
- )
384
- end
385
-
386
- def self.from_json!(json)
387
- from_dynamic!(JSON.parse(json))
388
- end
389
-
390
- def to_dynamic
391
- {
392
- "identityId" => identity_id,
393
- }
394
- end
395
-
396
- def to_json(options = nil)
397
- JSON.generate(to_dynamic, options)
398
- end
399
- end
400
-
401
- class CreateSecretOptions < Dry::Struct
402
- attribute :environment, Types::String
403
- attribute :path, Types::String.optional.optional
404
- attribute :project_id, Types::String
405
- attribute :secret_comment, Types::String.optional.optional
406
- attribute :secret_name, Types::String
407
- attribute :secret_value, Types::String
408
- attribute :skip_multiline_encoding, Types::Bool.optional.optional
409
- attribute :create_secret_options_type, Types::String.optional.optional
410
-
411
- def self.from_dynamic!(d)
412
- d = Types::Hash[d]
413
- new(
414
- environment: d.fetch("environment"),
415
- path: d["path"],
416
- project_id: d.fetch("projectId"),
417
- secret_comment: d["secretComment"],
418
- secret_name: d.fetch("secretName"),
419
- secret_value: d.fetch("secretValue"),
420
- skip_multiline_encoding: d["skipMultilineEncoding"],
421
- create_secret_options_type: d["type"],
422
- )
423
- end
424
-
425
- def self.from_json!(json)
426
- from_dynamic!(JSON.parse(json))
427
- end
428
-
429
- def to_dynamic
430
- {
431
- "environment" => environment,
432
- "path" => path,
433
- "projectId" => project_id,
434
- "secretComment" => secret_comment,
435
- "secretName" => secret_name,
436
- "secretValue" => secret_value,
437
- "skipMultilineEncoding" => skip_multiline_encoding,
438
- "type" => create_secret_options_type,
439
- }
440
- end
441
-
442
- def to_json(options = nil)
443
- JSON.generate(to_dynamic, options)
444
- end
445
- end
446
-
447
- class ArbitraryOptions < Dry::Struct
448
- attribute :data, Types::String
449
-
450
- def self.from_dynamic!(d)
451
- d = Types::Hash[d]
452
- new(
453
- data: d.fetch("data"),
454
- )
455
- end
456
-
457
- def self.from_json!(json)
458
- from_dynamic!(JSON.parse(json))
459
- end
460
-
461
- def to_dynamic
462
- {
463
- "data" => data,
464
- }
465
- end
466
-
467
- def to_json(options = nil)
468
- JSON.generate(to_dynamic, options)
469
- end
470
- end
471
-
472
- class DecryptSymmetricOptions < Dry::Struct
473
- attribute :ciphertext, Types::String
474
- attribute :iv, Types::String
475
- attribute :key, Types::String
476
- attribute :tag, Types::String
477
-
478
- def self.from_dynamic!(d)
479
- d = Types::Hash[d]
480
- new(
481
- ciphertext: d.fetch("ciphertext"),
482
- iv: d.fetch("iv"),
483
- key: d.fetch("key"),
484
- tag: d.fetch("tag"),
485
- )
486
- end
487
-
488
- def self.from_json!(json)
489
- from_dynamic!(JSON.parse(json))
490
- end
491
-
492
- def to_dynamic
493
- {
494
- "ciphertext" => ciphertext,
495
- "iv" => iv,
496
- "key" => key,
497
- "tag" => tag,
498
- }
499
- end
500
-
501
- def to_json(options = nil)
502
- JSON.generate(to_dynamic, options)
503
- end
504
- end
505
-
506
- class DeleteSecretOptions < Dry::Struct
507
- attribute :environment, Types::String
508
- attribute :path, Types::String.optional.optional
509
- attribute :project_id, Types::String
510
- attribute :secret_name, Types::String
511
- attribute :delete_secret_options_type, Types::String.optional.optional
512
-
513
- def self.from_dynamic!(d)
514
- d = Types::Hash[d]
515
- new(
516
- environment: d.fetch("environment"),
517
- path: d["path"],
518
- project_id: d.fetch("projectId"),
519
- secret_name: d.fetch("secretName"),
520
- delete_secret_options_type: d["type"],
521
- )
522
- end
523
-
524
- def self.from_json!(json)
525
- from_dynamic!(JSON.parse(json))
526
- end
527
-
528
- def to_dynamic
529
- {
530
- "environment" => environment,
531
- "path" => path,
532
- "projectId" => project_id,
533
- "secretName" => secret_name,
534
- "type" => delete_secret_options_type,
535
- }
536
- end
537
-
538
- def to_json(options = nil)
539
- JSON.generate(to_dynamic, options)
540
- end
541
- end
542
-
543
- class EncryptSymmetricOptions < Dry::Struct
544
- attribute :key, Types::String
545
- attribute :plaintext, Types::String
546
-
547
- def self.from_dynamic!(d)
548
- d = Types::Hash[d]
549
- new(
550
- key: d.fetch("key"),
551
- plaintext: d.fetch("plaintext"),
552
- )
553
- end
554
-
555
- def self.from_json!(json)
556
- from_dynamic!(JSON.parse(json))
557
- end
558
-
559
- def to_dynamic
560
- {
561
- "key" => key,
562
- "plaintext" => plaintext,
563
- }
564
- end
565
-
566
- def to_json(options = nil)
567
- JSON.generate(to_dynamic, options)
568
- end
569
- end
570
-
571
- class GcpIamAuthLoginClass < Dry::Struct
572
- attribute :identity_id, Types::String
573
-
574
- # The path to the GCP Service Account key file.
575
- #
576
- # You can generate this key file by going to the GCP Console -> IAM & Admin -> Service
577
- # Accounts -> *Select your service account* -> Keys tab -> Add key.
578
- # Note: The key must be in JSON format.
579
- attribute :service_account_key_file_path, Types::String
580
-
581
- def self.from_dynamic!(d)
582
- d = Types::Hash[d]
583
- new(
584
- identity_id: d.fetch("identityId"),
585
- service_account_key_file_path: d.fetch("serviceAccountKeyFilePath"),
586
- )
587
- end
588
-
589
- def self.from_json!(json)
590
- from_dynamic!(JSON.parse(json))
591
- end
592
-
593
- def to_dynamic
594
- {
595
- "identityId" => identity_id,
596
- "serviceAccountKeyFilePath" => service_account_key_file_path,
597
- }
598
- end
599
-
600
- def to_json(options = nil)
601
- JSON.generate(to_dynamic, options)
602
- end
603
- end
604
-
605
- class GcpIDTokenAuthLoginClass < Dry::Struct
606
- attribute :identity_id, Types::String
607
-
608
- def self.from_dynamic!(d)
609
- d = Types::Hash[d]
610
- new(
611
- identity_id: d.fetch("identityId"),
612
- )
613
- end
614
-
615
- def self.from_json!(json)
616
- from_dynamic!(JSON.parse(json))
617
- end
618
-
619
- def to_dynamic
620
- {
621
- "identityId" => identity_id,
622
- }
623
- end
624
-
625
- def to_json(options = nil)
626
- JSON.generate(to_dynamic, options)
627
- end
628
- end
629
-
630
- class GetSecretOptions < Dry::Struct
631
- attribute :environment, Types::String
632
- attribute :expand_secret_references, Types::Bool.optional.optional
633
- attribute :include_imports, Types::Bool.optional.optional
634
- attribute :path, Types::String.optional.optional
635
- attribute :project_id, Types::String
636
- attribute :secret_name, Types::String
637
- attribute :get_secret_options_type, Types::String.optional.optional
638
-
639
- def self.from_dynamic!(d)
640
- d = Types::Hash[d]
641
- new(
642
- environment: d.fetch("environment"),
643
- expand_secret_references: d["expandSecretReferences"],
644
- include_imports: d["includeImports"],
645
- path: d["path"],
646
- project_id: d.fetch("projectId"),
647
- secret_name: d.fetch("secretName"),
648
- get_secret_options_type: d["type"],
649
- )
650
- end
651
-
652
- def self.from_json!(json)
653
- from_dynamic!(JSON.parse(json))
654
- end
655
-
656
- def to_dynamic
657
- {
658
- "environment" => environment,
659
- "expandSecretReferences" => expand_secret_references,
660
- "includeImports" => include_imports,
661
- "path" => path,
662
- "projectId" => project_id,
663
- "secretName" => secret_name,
664
- "type" => get_secret_options_type,
665
- }
666
- end
667
-
668
- def to_json(options = nil)
669
- JSON.generate(to_dynamic, options)
670
- end
671
- end
672
-
673
- class KubernetesAuthLoginClass < Dry::Struct
674
-
675
- # The Infisical Identity ID that you want to authenticate to Infisical with.
676
- attribute :identity_id, Types::String
677
-
678
- # The path to the Kubernetes Service Account token file.
679
- #
680
- # If no path is provided, it will default to
681
- # /var/run/secrets/kubernetes.io/serviceaccount/token.
682
- attribute :service_account_token_path, Types::String.optional.optional
683
-
684
- def self.from_dynamic!(d)
685
- d = Types::Hash[d]
686
- new(
687
- identity_id: d.fetch("identityId"),
688
- service_account_token_path: d["serviceAccountTokenPath"],
689
- )
690
- end
691
-
692
- def self.from_json!(json)
693
- from_dynamic!(JSON.parse(json))
694
- end
695
-
696
- def to_dynamic
697
- {
698
- "identityId" => identity_id,
699
- "serviceAccountTokenPath" => service_account_token_path,
700
- }
701
- end
702
-
703
- def to_json(options = nil)
704
- JSON.generate(to_dynamic, options)
705
- end
706
- end
707
-
708
- class ListSecretsOptions < Dry::Struct
709
- attribute :attach_to_process_env, Types::Bool.optional.optional
710
- attribute :environment, Types::String
711
- attribute :expand_secret_references, Types::Bool.optional.optional
712
- attribute :include_imports, Types::Bool.optional.optional
713
- attribute :path, Types::String.optional.optional
714
- attribute :project_id, Types::String
715
- attribute :recursive, Types::Bool.optional.optional
716
-
717
- def self.from_dynamic!(d)
718
- d = Types::Hash[d]
719
- new(
720
- attach_to_process_env: d["attachToProcessEnv"],
721
- environment: d.fetch("environment"),
722
- expand_secret_references: d["expandSecretReferences"],
723
- include_imports: d["includeImports"],
724
- path: d["path"],
725
- project_id: d.fetch("projectId"),
726
- recursive: d["recursive"],
727
- )
728
- end
729
-
730
- def self.from_json!(json)
731
- from_dynamic!(JSON.parse(json))
732
- end
733
-
734
- def to_dynamic
735
- {
736
- "attachToProcessEnv" => attach_to_process_env,
737
- "environment" => environment,
738
- "expandSecretReferences" => expand_secret_references,
739
- "includeImports" => include_imports,
740
- "path" => path,
741
- "projectId" => project_id,
742
- "recursive" => recursive,
743
- }
744
- end
745
-
746
- def to_json(options = nil)
747
- JSON.generate(to_dynamic, options)
748
- end
749
- end
750
-
751
- class UniversalAuthLoginClass < Dry::Struct
752
- attribute :client_id, Types::String
753
- attribute :client_secret, Types::String
754
-
755
- def self.from_dynamic!(d)
756
- d = Types::Hash[d]
757
- new(
758
- client_id: d.fetch("clientId"),
759
- client_secret: d.fetch("clientSecret"),
760
- )
761
- end
762
-
763
- def self.from_json!(json)
764
- from_dynamic!(JSON.parse(json))
765
- end
766
-
767
- def to_dynamic
768
- {
769
- "clientId" => client_id,
770
- "clientSecret" => client_secret,
771
- }
772
- end
773
-
774
- def to_json(options = nil)
775
- JSON.generate(to_dynamic, options)
776
- end
777
- end
778
-
779
- class UpdateSecretOptions < Dry::Struct
780
- attribute :environment, Types::String
781
- attribute :path, Types::String.optional.optional
782
- attribute :project_id, Types::String
783
- attribute :secret_name, Types::String
784
- attribute :secret_value, Types::String
785
- attribute :skip_multiline_encoding, Types::Bool.optional.optional
786
- attribute :update_secret_options_type, Types::String.optional.optional
787
-
788
- def self.from_dynamic!(d)
789
- d = Types::Hash[d]
790
- new(
791
- environment: d.fetch("environment"),
792
- path: d["path"],
793
- project_id: d.fetch("projectId"),
794
- secret_name: d.fetch("secretName"),
795
- secret_value: d.fetch("secretValue"),
796
- skip_multiline_encoding: d["skipMultilineEncoding"],
797
- update_secret_options_type: d["type"],
798
- )
799
- end
800
-
801
- def self.from_json!(json)
802
- from_dynamic!(JSON.parse(json))
803
- end
804
-
805
- def to_dynamic
806
- {
807
- "environment" => environment,
808
- "path" => path,
809
- "projectId" => project_id,
810
- "secretName" => secret_name,
811
- "secretValue" => secret_value,
812
- "skipMultilineEncoding" => skip_multiline_encoding,
813
- "type" => update_secret_options_type,
814
- }
815
- end
816
-
817
- def to_json(options = nil)
818
- JSON.generate(to_dynamic, options)
819
- end
820
- end
821
-
822
- class CommandList < Dry::Struct
823
- attribute :get_secret, GetSecretOptions.optional
824
- attribute :list_secrets, ListSecretsOptions.optional
825
- attribute :create_secret, CreateSecretOptions.optional
826
- attribute :update_secret, UpdateSecretOptions.optional
827
- attribute :delete_secret, DeleteSecretOptions.optional
828
- attribute :create_symmetric_key, ArbitraryOptions.optional
829
- attribute :encrypt_symmetric, EncryptSymmetricOptions.optional
830
- attribute :decrypt_symmetric, DecryptSymmetricOptions.optional
831
- attribute :universal_auth_login, UniversalAuthLoginClass.optional
832
- attribute :kubernetes_auth_login, KubernetesAuthLoginClass.optional
833
- attribute :azure_auth_login, AzureAuthLoginClass.optional
834
- attribute :gcp_id_token_auth_login, GcpIDTokenAuthLoginClass.optional
835
- attribute :gcp_iam_auth_login, GcpIamAuthLoginClass.optional
836
- attribute :aws_iam_auth_login, AwsIamAuthLoginClass.optional
837
-
838
- def self.from_dynamic!(d)
839
- d = Types::Hash[d]
840
- new(
841
- get_secret: d["getSecret"] ? GetSecretOptions.from_dynamic!(d["getSecret"]) : nil,
842
- list_secrets: d["listSecrets"] ? ListSecretsOptions.from_dynamic!(d["listSecrets"]) : nil,
843
- create_secret: d["createSecret"] ? CreateSecretOptions.from_dynamic!(d["createSecret"]) : nil,
844
- update_secret: d["updateSecret"] ? UpdateSecretOptions.from_dynamic!(d["updateSecret"]) : nil,
845
- delete_secret: d["deleteSecret"] ? DeleteSecretOptions.from_dynamic!(d["deleteSecret"]) : nil,
846
- create_symmetric_key: d["createSymmetricKey"] ? ArbitraryOptions.from_dynamic!(d["createSymmetricKey"]) : nil,
847
- encrypt_symmetric: d["encryptSymmetric"] ? EncryptSymmetricOptions.from_dynamic!(d["encryptSymmetric"]) : nil,
848
- decrypt_symmetric: d["decryptSymmetric"] ? DecryptSymmetricOptions.from_dynamic!(d["decryptSymmetric"]) : nil,
849
- universal_auth_login: d["universalAuthLogin"] ? UniversalAuthLoginClass.from_dynamic!(d["universalAuthLogin"]) : nil,
850
- kubernetes_auth_login: d["kubernetesAuthLogin"] ? KubernetesAuthLoginClass.from_dynamic!(d["kubernetesAuthLogin"]) : nil,
851
- azure_auth_login: d["azureAuthLogin"] ? AzureAuthLoginClass.from_dynamic!(d["azureAuthLogin"]) : nil,
852
- gcp_id_token_auth_login: d["gcpIdTokenAuthLogin"] ? GcpIDTokenAuthLoginClass.from_dynamic!(d["gcpIdTokenAuthLogin"]) : nil,
853
- gcp_iam_auth_login: d["gcpIamAuthLogin"] ? GcpIamAuthLoginClass.from_dynamic!(d["gcpIamAuthLogin"]) : nil,
854
- aws_iam_auth_login: d["awsIamAuthLogin"] ? AwsIamAuthLoginClass.from_dynamic!(d["awsIamAuthLogin"]) : nil,
855
- )
856
- end
857
-
858
- def self.from_json!(json)
859
- from_dynamic!(JSON.parse(json))
860
- end
861
-
862
- def to_dynamic
863
- {
864
- "getSecret" => get_secret&.to_dynamic,
865
- "listSecrets" => list_secrets&.to_dynamic,
866
- "createSecret" => create_secret&.to_dynamic,
867
- "updateSecret" => update_secret&.to_dynamic,
868
- "deleteSecret" => delete_secret&.to_dynamic,
869
- "createSymmetricKey" => create_symmetric_key&.to_dynamic,
870
- "encryptSymmetric" => encrypt_symmetric&.to_dynamic,
871
- "decryptSymmetric" => decrypt_symmetric&.to_dynamic,
872
- "universalAuthLogin" => universal_auth_login&.to_dynamic,
873
- "kubernetesAuthLogin" => kubernetes_auth_login&.to_dynamic,
874
- "azureAuthLogin" => azure_auth_login&.to_dynamic,
875
- "gcpIdTokenAuthLogin" => gcp_id_token_auth_login&.to_dynamic,
876
- "gcpIamAuthLogin" => gcp_iam_auth_login&.to_dynamic,
877
- "awsIamAuthLogin" => aws_iam_auth_login&.to_dynamic,
878
- }
879
- end
880
-
881
- def to_json(options = nil)
882
- JSON.generate(to_dynamic, options)
883
- end
884
- end
885
-
886
- class AccessTokenSuccessResponse < Dry::Struct
887
- attribute :access_token, Types::String
888
- attribute :access_token_max_ttl, Types::Integer
889
- attribute :expires_in, Types::Integer
890
- attribute :token_type, Types::String
891
-
892
- def self.from_dynamic!(d)
893
- d = Types::Hash[d]
894
- new(
895
- access_token: d.fetch("accessToken"),
896
- access_token_max_ttl: d.fetch("accessTokenMaxTTL"),
897
- expires_in: d.fetch("expiresIn"),
898
- token_type: d.fetch("tokenType"),
899
- )
900
- end
901
-
902
- def self.from_json!(json)
903
- from_dynamic!(JSON.parse(json))
904
- end
905
-
906
- def to_dynamic
907
- {
908
- "accessToken" => access_token,
909
- "accessTokenMaxTTL" => access_token_max_ttl,
910
- "expiresIn" => expires_in,
911
- "tokenType" => token_type,
912
- }
913
- end
914
-
915
- def to_json(options = nil)
916
- JSON.generate(to_dynamic, options)
917
- end
918
- end
919
-
920
- class APIResultForAccessTokenSuccessResponse < Dry::Struct
921
- attribute :data, AccessTokenSuccessResponse.optional.optional
922
- attribute :message, Types::String.optional.optional
923
- attribute :status, Types::Bool
924
-
925
- def self.from_dynamic!(d)
926
- d = Types::Hash[d]
927
- new(
928
- data: d["data"] ? AccessTokenSuccessResponse.from_dynamic!(d["data"]) : nil,
929
- message: d["message"],
930
- status: d.fetch("status"),
931
- )
932
- end
933
-
934
- def self.from_json!(json)
935
- from_dynamic!(JSON.parse(json))
936
- end
937
-
938
- def to_dynamic
939
- {
940
- "data" => data&.to_dynamic,
941
- "message" => message,
942
- "status" => status,
943
- }
944
- end
945
-
946
- def to_json(options = nil)
947
- JSON.generate(to_dynamic, options)
948
- end
949
- end
950
-
951
- class CreateSecretResponseSecret < Dry::Struct
952
- attribute :environment, Types::String
953
- attribute :is_fallback, Types::Bool.optional
954
- attribute :secret_comment, Types::String
955
- attribute :secret_key, Types::String
956
-
957
- # The path of the secret.
958
- #
959
- # Note that this will only be present when using the `list secrets` method.
960
- attribute :secret_path, Types::String.optional.optional
961
-
962
- attribute :secret_value, Types::String
963
- attribute :secret_type, Types::String
964
- attribute :version, Types::Integer
965
- attribute :workspace, Types::String
966
-
967
- def self.from_dynamic!(d)
968
- d = Types::Hash[d]
969
- new(
970
- environment: d.fetch("environment"),
971
- is_fallback: d["isFallback"],
972
- secret_comment: d.fetch("secretComment"),
973
- secret_key: d.fetch("secretKey"),
974
- secret_path: d["secretPath"],
975
- secret_value: d.fetch("secretValue"),
976
- secret_type: d.fetch("type"),
977
- version: d.fetch("version"),
978
- workspace: d.fetch("workspace"),
979
- )
980
- end
981
-
982
- def self.from_json!(json)
983
- from_dynamic!(JSON.parse(json))
984
- end
985
-
986
- def to_dynamic
987
- {
988
- "environment" => environment,
989
- "isFallback" => is_fallback,
990
- "secretComment" => secret_comment,
991
- "secretKey" => secret_key,
992
- "secretPath" => secret_path,
993
- "secretValue" => secret_value,
994
- "type" => secret_type,
995
- "version" => version,
996
- "workspace" => workspace,
997
- }
998
- end
999
-
1000
- def to_json(options = nil)
1001
- JSON.generate(to_dynamic, options)
1002
- end
1003
- end
1004
-
1005
- class CreateSecretResponse < Dry::Struct
1006
- attribute :secret, CreateSecretResponseSecret
1007
-
1008
- def self.from_dynamic!(d)
1009
- d = Types::Hash[d]
1010
- new(
1011
- secret: CreateSecretResponseSecret.from_dynamic!(d.fetch("secret")),
1012
- )
1013
- end
1014
-
1015
- def self.from_json!(json)
1016
- from_dynamic!(JSON.parse(json))
1017
- end
1018
-
1019
- def to_dynamic
1020
- {
1021
- "secret" => secret.to_dynamic,
1022
- }
1023
- end
1024
-
1025
- def to_json(options = nil)
1026
- JSON.generate(to_dynamic, options)
1027
- end
1028
- end
1029
-
1030
- class APIResultForCreateSecretResponse < Dry::Struct
1031
- attribute :data, CreateSecretResponse.optional.optional
1032
- attribute :message, Types::String.optional.optional
1033
- attribute :status, Types::Bool
1034
-
1035
- def self.from_dynamic!(d)
1036
- d = Types::Hash[d]
1037
- new(
1038
- data: d["data"] ? CreateSecretResponse.from_dynamic!(d["data"]) : nil,
1039
- message: d["message"],
1040
- status: d.fetch("status"),
1041
- )
1042
- end
1043
-
1044
- def self.from_json!(json)
1045
- from_dynamic!(JSON.parse(json))
1046
- end
1047
-
1048
- def to_dynamic
1049
- {
1050
- "data" => data&.to_dynamic,
1051
- "message" => message,
1052
- "status" => status,
1053
- }
1054
- end
1055
-
1056
- def to_json(options = nil)
1057
- JSON.generate(to_dynamic, options)
1058
- end
1059
- end
1060
-
1061
- class CreateSymmetricKeyResponse < Dry::Struct
1062
- attribute :key, Types::String
1063
-
1064
- def self.from_dynamic!(d)
1065
- d = Types::Hash[d]
1066
- new(
1067
- key: d.fetch("key"),
1068
- )
1069
- end
1070
-
1071
- def self.from_json!(json)
1072
- from_dynamic!(JSON.parse(json))
1073
- end
1074
-
1075
- def to_dynamic
1076
- {
1077
- "key" => key,
1078
- }
1079
- end
1080
-
1081
- def to_json(options = nil)
1082
- JSON.generate(to_dynamic, options)
1083
- end
1084
- end
1085
-
1086
- class APIResultForCreateSymmetricKeyResponse < Dry::Struct
1087
- attribute :data, CreateSymmetricKeyResponse.optional.optional
1088
- attribute :message, Types::String.optional.optional
1089
- attribute :status, Types::Bool
1090
-
1091
- def self.from_dynamic!(d)
1092
- d = Types::Hash[d]
1093
- new(
1094
- data: d["data"] ? CreateSymmetricKeyResponse.from_dynamic!(d["data"]) : nil,
1095
- message: d["message"],
1096
- status: d.fetch("status"),
1097
- )
1098
- end
1099
-
1100
- def self.from_json!(json)
1101
- from_dynamic!(JSON.parse(json))
1102
- end
1103
-
1104
- def to_dynamic
1105
- {
1106
- "data" => data&.to_dynamic,
1107
- "message" => message,
1108
- "status" => status,
1109
- }
1110
- end
1111
-
1112
- def to_json(options = nil)
1113
- JSON.generate(to_dynamic, options)
1114
- end
1115
- end
1116
-
1117
- class DecryptSymmetricResponse < Dry::Struct
1118
- attribute :decrypted, Types::String
1119
-
1120
- def self.from_dynamic!(d)
1121
- d = Types::Hash[d]
1122
- new(
1123
- decrypted: d.fetch("decrypted"),
1124
- )
1125
- end
1126
-
1127
- def self.from_json!(json)
1128
- from_dynamic!(JSON.parse(json))
1129
- end
1130
-
1131
- def to_dynamic
1132
- {
1133
- "decrypted" => decrypted,
1134
- }
1135
- end
1136
-
1137
- def to_json(options = nil)
1138
- JSON.generate(to_dynamic, options)
1139
- end
1140
- end
1141
-
1142
- class APIResultForDecryptSymmetricResponse < Dry::Struct
1143
- attribute :data, DecryptSymmetricResponse.optional.optional
1144
- attribute :message, Types::String.optional.optional
1145
- attribute :status, Types::Bool
1146
-
1147
- def self.from_dynamic!(d)
1148
- d = Types::Hash[d]
1149
- new(
1150
- data: d["data"] ? DecryptSymmetricResponse.from_dynamic!(d["data"]) : nil,
1151
- message: d["message"],
1152
- status: d.fetch("status"),
1153
- )
1154
- end
1155
-
1156
- def self.from_json!(json)
1157
- from_dynamic!(JSON.parse(json))
1158
- end
1159
-
1160
- def to_dynamic
1161
- {
1162
- "data" => data&.to_dynamic,
1163
- "message" => message,
1164
- "status" => status,
1165
- }
1166
- end
1167
-
1168
- def to_json(options = nil)
1169
- JSON.generate(to_dynamic, options)
1170
- end
1171
- end
1172
-
1173
- class DeleteSecretResponseSecret < Dry::Struct
1174
- attribute :environment, Types::String
1175
- attribute :is_fallback, Types::Bool.optional
1176
- attribute :secret_comment, Types::String
1177
- attribute :secret_key, Types::String
1178
-
1179
- # The path of the secret.
1180
- #
1181
- # Note that this will only be present when using the `list secrets` method.
1182
- attribute :secret_path, Types::String.optional.optional
1183
-
1184
- attribute :secret_value, Types::String
1185
- attribute :secret_type, Types::String
1186
- attribute :version, Types::Integer
1187
- attribute :workspace, Types::String
1188
-
1189
- def self.from_dynamic!(d)
1190
- d = Types::Hash[d]
1191
- new(
1192
- environment: d.fetch("environment"),
1193
- is_fallback: d["isFallback"],
1194
- secret_comment: d.fetch("secretComment"),
1195
- secret_key: d.fetch("secretKey"),
1196
- secret_path: d["secretPath"],
1197
- secret_value: d.fetch("secretValue"),
1198
- secret_type: d.fetch("type"),
1199
- version: d.fetch("version"),
1200
- workspace: d.fetch("workspace"),
1201
- )
1202
- end
1203
-
1204
- def self.from_json!(json)
1205
- from_dynamic!(JSON.parse(json))
1206
- end
1207
-
1208
- def to_dynamic
1209
- {
1210
- "environment" => environment,
1211
- "isFallback" => is_fallback,
1212
- "secretComment" => secret_comment,
1213
- "secretKey" => secret_key,
1214
- "secretPath" => secret_path,
1215
- "secretValue" => secret_value,
1216
- "type" => secret_type,
1217
- "version" => version,
1218
- "workspace" => workspace,
1219
- }
1220
- end
1221
-
1222
- def to_json(options = nil)
1223
- JSON.generate(to_dynamic, options)
1224
- end
1225
- end
1226
-
1227
- class DeleteSecretResponse < Dry::Struct
1228
- attribute :secret, DeleteSecretResponseSecret
1229
-
1230
- def self.from_dynamic!(d)
1231
- d = Types::Hash[d]
1232
- new(
1233
- secret: DeleteSecretResponseSecret.from_dynamic!(d.fetch("secret")),
1234
- )
1235
- end
1236
-
1237
- def self.from_json!(json)
1238
- from_dynamic!(JSON.parse(json))
1239
- end
1240
-
1241
- def to_dynamic
1242
- {
1243
- "secret" => secret.to_dynamic,
1244
- }
1245
- end
1246
-
1247
- def to_json(options = nil)
1248
- JSON.generate(to_dynamic, options)
1249
- end
1250
- end
1251
-
1252
- class APIResultForDeleteSecretResponse < Dry::Struct
1253
- attribute :data, DeleteSecretResponse.optional.optional
1254
- attribute :message, Types::String.optional.optional
1255
- attribute :status, Types::Bool
1256
-
1257
- def self.from_dynamic!(d)
1258
- d = Types::Hash[d]
1259
- new(
1260
- data: d["data"] ? DeleteSecretResponse.from_dynamic!(d["data"]) : nil,
1261
- message: d["message"],
1262
- status: d.fetch("status"),
1263
- )
1264
- end
1265
-
1266
- def self.from_json!(json)
1267
- from_dynamic!(JSON.parse(json))
1268
- end
1269
-
1270
- def to_dynamic
1271
- {
1272
- "data" => data&.to_dynamic,
1273
- "message" => message,
1274
- "status" => status,
1275
- }
1276
- end
1277
-
1278
- def to_json(options = nil)
1279
- JSON.generate(to_dynamic, options)
1280
- end
1281
- end
1282
-
1283
- class EncryptSymmetricResponse < Dry::Struct
1284
- attribute :ciphertext, Types::String
1285
- attribute :iv, Types::String
1286
- attribute :tag, Types::String
1287
-
1288
- def self.from_dynamic!(d)
1289
- d = Types::Hash[d]
1290
- new(
1291
- ciphertext: d.fetch("ciphertext"),
1292
- iv: d.fetch("iv"),
1293
- tag: d.fetch("tag"),
1294
- )
1295
- end
1296
-
1297
- def self.from_json!(json)
1298
- from_dynamic!(JSON.parse(json))
1299
- end
1300
-
1301
- def to_dynamic
1302
- {
1303
- "ciphertext" => ciphertext,
1304
- "iv" => iv,
1305
- "tag" => tag,
1306
- }
1307
- end
1308
-
1309
- def to_json(options = nil)
1310
- JSON.generate(to_dynamic, options)
1311
- end
1312
- end
1313
-
1314
- class APIResultForEncryptSymmetricResponse < Dry::Struct
1315
- attribute :data, EncryptSymmetricResponse.optional.optional
1316
- attribute :message, Types::String.optional.optional
1317
- attribute :status, Types::Bool
1318
-
1319
- def self.from_dynamic!(d)
1320
- d = Types::Hash[d]
1321
- new(
1322
- data: d["data"] ? EncryptSymmetricResponse.from_dynamic!(d["data"]) : nil,
1323
- message: d["message"],
1324
- status: d.fetch("status"),
1325
- )
1326
- end
1327
-
1328
- def self.from_json!(json)
1329
- from_dynamic!(JSON.parse(json))
1330
- end
1331
-
1332
- def to_dynamic
1333
- {
1334
- "data" => data&.to_dynamic,
1335
- "message" => message,
1336
- "status" => status,
1337
- }
1338
- end
1339
-
1340
- def to_json(options = nil)
1341
- JSON.generate(to_dynamic, options)
1342
- end
1343
- end
1344
-
1345
- class GetSecretResponseSecret < Dry::Struct
1346
- attribute :environment, Types::String
1347
- attribute :is_fallback, Types::Bool.optional
1348
- attribute :secret_comment, Types::String
1349
- attribute :secret_key, Types::String
1350
-
1351
- # The path of the secret.
1352
- #
1353
- # Note that this will only be present when using the `list secrets` method.
1354
- attribute :secret_path, Types::String.optional.optional
1355
-
1356
- attribute :secret_value, Types::String
1357
- attribute :secret_type, Types::String
1358
- attribute :version, Types::Integer
1359
- attribute :workspace, Types::String
1360
-
1361
- def self.from_dynamic!(d)
1362
- d = Types::Hash[d]
1363
- new(
1364
- environment: d.fetch("environment"),
1365
- is_fallback: d["isFallback"],
1366
- secret_comment: d.fetch("secretComment"),
1367
- secret_key: d.fetch("secretKey"),
1368
- secret_path: d["secretPath"],
1369
- secret_value: d.fetch("secretValue"),
1370
- secret_type: d.fetch("type"),
1371
- version: d.fetch("version"),
1372
- workspace: d.fetch("workspace"),
1373
- )
1374
- end
1375
-
1376
- def self.from_json!(json)
1377
- from_dynamic!(JSON.parse(json))
1378
- end
1379
-
1380
- def to_dynamic
1381
- {
1382
- "environment" => environment,
1383
- "isFallback" => is_fallback,
1384
- "secretComment" => secret_comment,
1385
- "secretKey" => secret_key,
1386
- "secretPath" => secret_path,
1387
- "secretValue" => secret_value,
1388
- "type" => secret_type,
1389
- "version" => version,
1390
- "workspace" => workspace,
1391
- }
1392
- end
1393
-
1394
- def to_json(options = nil)
1395
- JSON.generate(to_dynamic, options)
1396
- end
1397
- end
1398
-
1399
- class GetSecretResponse < Dry::Struct
1400
- attribute :secret, GetSecretResponseSecret
1401
-
1402
- def self.from_dynamic!(d)
1403
- d = Types::Hash[d]
1404
- new(
1405
- secret: GetSecretResponseSecret.from_dynamic!(d.fetch("secret")),
1406
- )
1407
- end
1408
-
1409
- def self.from_json!(json)
1410
- from_dynamic!(JSON.parse(json))
1411
- end
1412
-
1413
- def to_dynamic
1414
- {
1415
- "secret" => secret.to_dynamic,
1416
- }
1417
- end
1418
-
1419
- def to_json(options = nil)
1420
- JSON.generate(to_dynamic, options)
1421
- end
1422
- end
1423
-
1424
- class APIResultForGetSecretResponse < Dry::Struct
1425
- attribute :data, GetSecretResponse.optional.optional
1426
- attribute :message, Types::String.optional.optional
1427
- attribute :status, Types::Bool
1428
-
1429
- def self.from_dynamic!(d)
1430
- d = Types::Hash[d]
1431
- new(
1432
- data: d["data"] ? GetSecretResponse.from_dynamic!(d["data"]) : nil,
1433
- message: d["message"],
1434
- status: d.fetch("status"),
1435
- )
1436
- end
1437
-
1438
- def self.from_json!(json)
1439
- from_dynamic!(JSON.parse(json))
1440
- end
1441
-
1442
- def to_dynamic
1443
- {
1444
- "data" => data&.to_dynamic,
1445
- "message" => message,
1446
- "status" => status,
1447
- }
1448
- end
1449
-
1450
- def to_json(options = nil)
1451
- JSON.generate(to_dynamic, options)
1452
- end
1453
- end
1454
-
1455
- class SecretElement < Dry::Struct
1456
- attribute :environment, Types::String
1457
- attribute :is_fallback, Types::Bool.optional
1458
- attribute :secret_comment, Types::String
1459
- attribute :secret_key, Types::String
1460
-
1461
- # The path of the secret.
1462
- #
1463
- # Note that this will only be present when using the `list secrets` method.
1464
- attribute :secret_path, Types::String.optional.optional
1465
-
1466
- attribute :secret_value, Types::String
1467
- attribute :secret_type, Types::String
1468
- attribute :version, Types::Integer
1469
- attribute :workspace, Types::String
1470
-
1471
- def self.from_dynamic!(d)
1472
- d = Types::Hash[d]
1473
- new(
1474
- environment: d.fetch("environment"),
1475
- is_fallback: d["isFallback"],
1476
- secret_comment: d.fetch("secretComment"),
1477
- secret_key: d.fetch("secretKey"),
1478
- secret_path: d["secretPath"],
1479
- secret_value: d.fetch("secretValue"),
1480
- secret_type: d.fetch("type"),
1481
- version: d.fetch("version"),
1482
- workspace: d.fetch("workspace"),
1483
- )
1484
- end
1485
-
1486
- def self.from_json!(json)
1487
- from_dynamic!(JSON.parse(json))
1488
- end
1489
-
1490
- def to_dynamic
1491
- {
1492
- "environment" => environment,
1493
- "isFallback" => is_fallback,
1494
- "secretComment" => secret_comment,
1495
- "secretKey" => secret_key,
1496
- "secretPath" => secret_path,
1497
- "secretValue" => secret_value,
1498
- "type" => secret_type,
1499
- "version" => version,
1500
- "workspace" => workspace,
1501
- }
1502
- end
1503
-
1504
- def to_json(options = nil)
1505
- JSON.generate(to_dynamic, options)
1506
- end
1507
- end
1508
-
1509
- class ListSecretsResponse < Dry::Struct
1510
- attribute :secrets, Types.Array(SecretElement)
1511
-
1512
- def self.from_dynamic!(d)
1513
- d = Types::Hash[d]
1514
- new(
1515
- secrets: d.fetch("secrets").map { |x| SecretElement.from_dynamic!(x) },
1516
- )
1517
- end
1518
-
1519
- def self.from_json!(json)
1520
- from_dynamic!(JSON.parse(json))
1521
- end
1522
-
1523
- def to_dynamic
1524
- {
1525
- "secrets" => secrets.map { |x| x.to_dynamic },
1526
- }
1527
- end
1528
-
1529
- def to_json(options = nil)
1530
- JSON.generate(to_dynamic, options)
1531
- end
1532
- end
1533
-
1534
- class APIResultForListSecretsResponse < Dry::Struct
1535
- attribute :data, ListSecretsResponse.optional.optional
1536
- attribute :message, Types::String.optional.optional
1537
- attribute :status, Types::Bool
1538
-
1539
- def self.from_dynamic!(d)
1540
- d = Types::Hash[d]
1541
- new(
1542
- data: d["data"] ? ListSecretsResponse.from_dynamic!(d["data"]) : nil,
1543
- message: d["message"],
1544
- status: d.fetch("status"),
1545
- )
1546
- end
1547
-
1548
- def self.from_json!(json)
1549
- from_dynamic!(JSON.parse(json))
1550
- end
1551
-
1552
- def to_dynamic
1553
- {
1554
- "data" => data&.to_dynamic,
1555
- "message" => message,
1556
- "status" => status,
1557
- }
1558
- end
1559
-
1560
- def to_json(options = nil)
1561
- JSON.generate(to_dynamic, options)
1562
- end
1563
- end
1564
-
1565
- class UpdateSecretResponseSecret < Dry::Struct
1566
- attribute :environment, Types::String
1567
- attribute :is_fallback, Types::Bool.optional
1568
- attribute :secret_comment, Types::String
1569
- attribute :secret_key, Types::String
1570
-
1571
- # The path of the secret.
1572
- #
1573
- # Note that this will only be present when using the `list secrets` method.
1574
- attribute :secret_path, Types::String.optional.optional
1575
-
1576
- attribute :secret_value, Types::String
1577
- attribute :secret_type, Types::String
1578
- attribute :version, Types::Integer
1579
- attribute :workspace, Types::String
1580
-
1581
- def self.from_dynamic!(d)
1582
- d = Types::Hash[d]
1583
- new(
1584
- environment: d.fetch("environment"),
1585
- is_fallback: d["isFallback"],
1586
- secret_comment: d.fetch("secretComment"),
1587
- secret_key: d.fetch("secretKey"),
1588
- secret_path: d["secretPath"],
1589
- secret_value: d.fetch("secretValue"),
1590
- secret_type: d.fetch("type"),
1591
- version: d.fetch("version"),
1592
- workspace: d.fetch("workspace"),
1593
- )
1594
- end
1595
-
1596
- def self.from_json!(json)
1597
- from_dynamic!(JSON.parse(json))
1598
- end
1599
-
1600
- def to_dynamic
1601
- {
1602
- "environment" => environment,
1603
- "isFallback" => is_fallback,
1604
- "secretComment" => secret_comment,
1605
- "secretKey" => secret_key,
1606
- "secretPath" => secret_path,
1607
- "secretValue" => secret_value,
1608
- "type" => secret_type,
1609
- "version" => version,
1610
- "workspace" => workspace,
1611
- }
1612
- end
1613
-
1614
- def to_json(options = nil)
1615
- JSON.generate(to_dynamic, options)
1616
- end
1617
- end
1618
-
1619
- class UpdateSecretResponse < Dry::Struct
1620
- attribute :secret, UpdateSecretResponseSecret
1621
-
1622
- def self.from_dynamic!(d)
1623
- d = Types::Hash[d]
1624
- new(
1625
- secret: UpdateSecretResponseSecret.from_dynamic!(d.fetch("secret")),
1626
- )
1627
- end
1628
-
1629
- def self.from_json!(json)
1630
- from_dynamic!(JSON.parse(json))
1631
- end
1632
-
1633
- def to_dynamic
1634
- {
1635
- "secret" => secret.to_dynamic,
1636
- }
1637
- end
1638
-
1639
- def to_json(options = nil)
1640
- JSON.generate(to_dynamic, options)
1641
- end
1642
- end
1643
-
1644
- class APIResultForUpdateSecretResponse < Dry::Struct
1645
- attribute :data, UpdateSecretResponse.optional.optional
1646
- attribute :message, Types::String.optional.optional
1647
- attribute :status, Types::Bool
1648
-
1649
- def self.from_dynamic!(d)
1650
- d = Types::Hash[d]
1651
- new(
1652
- data: d["data"] ? UpdateSecretResponse.from_dynamic!(d["data"]) : nil,
1653
- message: d["message"],
1654
- status: d.fetch("status"),
1655
- )
1656
- end
1657
-
1658
- def self.from_json!(json)
1659
- from_dynamic!(JSON.parse(json))
1660
- end
1661
-
1662
- def to_dynamic
1663
- {
1664
- "data" => data&.to_dynamic,
1665
- "message" => message,
1666
- "status" => status,
1667
- }
1668
- end
1669
-
1670
- def to_json(options = nil)
1671
- JSON.generate(to_dynamic, options)
1672
- end
1673
- end
1674
-