infisical-sdk 2.3.8 → 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 -1728
  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,1728 +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 = Command.from_json! "{…}"
10
- # puts command.aws_iam_auth_login&.identity_id
11
- #
12
- # response_for_access_token_success_response = ResponseForAccessTokenSuccessResponse.from_json! "{…}"
13
- # puts response_for_access_token_success_response.data&.access_token
14
- #
15
- # response_for_create_secret_response = ResponseForCreateSecretResponse.from_json! "{…}"
16
- # puts response_for_create_secret_response.data&.secret.environment
17
- #
18
- # response_for_create_symmetric_key_response = ResponseForCreateSymmetricKeyResponse.from_json! "{…}"
19
- # puts response_for_create_symmetric_key_response.data&.key
20
- #
21
- # response_for_decrypt_symmetric_response = ResponseForDecryptSymmetricResponse.from_json! "{…}"
22
- # puts response_for_decrypt_symmetric_response.data&.decrypted
23
- #
24
- # response_for_delete_secret_response = ResponseForDeleteSecretResponse.from_json! "{…}"
25
- # puts response_for_delete_secret_response.data&.secret.environment
26
- #
27
- # response_for_encrypt_symmetric_response = ResponseForEncryptSymmetricResponse.from_json! "{…}"
28
- # puts response_for_encrypt_symmetric_response.data&.ciphertext
29
- #
30
- # response_for_get_secret_response = ResponseForGetSecretResponse.from_json! "{…}"
31
- # puts response_for_get_secret_response.data&.secret.environment
32
- #
33
- # response_for_list_secrets_response = ResponseForListSecretsResponse.from_json! "{…}"
34
- # puts response_for_list_secrets_response.data&.secrets.first.environment
35
- #
36
- # response_for_update_secret_response = ResponseForUpdateSecretResponse.from_json! "{…}"
37
- # puts response_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 Command < 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 ResponseForAccessTokenSuccessResponse < Dry::Struct
921
-
922
- # The response data. Populated if `success` is true.
923
- attribute :data, AccessTokenSuccessResponse.optional.optional
924
-
925
- # A message for any error that may occur. Populated if `success` is false.
926
- attribute :error_message, Types::String.optional.optional
927
-
928
- # Whether or not the SDK request succeeded.
929
- attribute :success, Types::Bool
930
-
931
- def self.from_dynamic!(d)
932
- d = Types::Hash[d]
933
- new(
934
- data: d["data"] ? AccessTokenSuccessResponse.from_dynamic!(d["data"]) : nil,
935
- error_message: d["errorMessage"],
936
- success: d.fetch("success"),
937
- )
938
- end
939
-
940
- def self.from_json!(json)
941
- from_dynamic!(JSON.parse(json))
942
- end
943
-
944
- def to_dynamic
945
- {
946
- "data" => data&.to_dynamic,
947
- "errorMessage" => error_message,
948
- "success" => success,
949
- }
950
- end
951
-
952
- def to_json(options = nil)
953
- JSON.generate(to_dynamic, options)
954
- end
955
- end
956
-
957
- class CreateSecretResponseSecret < Dry::Struct
958
- attribute :environment, Types::String
959
- attribute :is_fallback, Types::Bool.optional
960
- attribute :secret_comment, Types::String
961
- attribute :secret_key, Types::String
962
-
963
- # The path of the secret.
964
- #
965
- # Note that this will only be present when using the `list secrets` method.
966
- attribute :secret_path, Types::String.optional.optional
967
-
968
- attribute :secret_value, Types::String
969
- attribute :secret_type, Types::String
970
- attribute :version, Types::Integer
971
- attribute :workspace, Types::String
972
-
973
- def self.from_dynamic!(d)
974
- d = Types::Hash[d]
975
- new(
976
- environment: d.fetch("environment"),
977
- is_fallback: d["isFallback"],
978
- secret_comment: d.fetch("secretComment"),
979
- secret_key: d.fetch("secretKey"),
980
- secret_path: d["secretPath"],
981
- secret_value: d.fetch("secretValue"),
982
- secret_type: d.fetch("type"),
983
- version: d.fetch("version"),
984
- workspace: d.fetch("workspace"),
985
- )
986
- end
987
-
988
- def self.from_json!(json)
989
- from_dynamic!(JSON.parse(json))
990
- end
991
-
992
- def to_dynamic
993
- {
994
- "environment" => environment,
995
- "isFallback" => is_fallback,
996
- "secretComment" => secret_comment,
997
- "secretKey" => secret_key,
998
- "secretPath" => secret_path,
999
- "secretValue" => secret_value,
1000
- "type" => secret_type,
1001
- "version" => version,
1002
- "workspace" => workspace,
1003
- }
1004
- end
1005
-
1006
- def to_json(options = nil)
1007
- JSON.generate(to_dynamic, options)
1008
- end
1009
- end
1010
-
1011
- class CreateSecretResponse < Dry::Struct
1012
- attribute :secret, CreateSecretResponseSecret
1013
-
1014
- def self.from_dynamic!(d)
1015
- d = Types::Hash[d]
1016
- new(
1017
- secret: CreateSecretResponseSecret.from_dynamic!(d.fetch("secret")),
1018
- )
1019
- end
1020
-
1021
- def self.from_json!(json)
1022
- from_dynamic!(JSON.parse(json))
1023
- end
1024
-
1025
- def to_dynamic
1026
- {
1027
- "secret" => secret.to_dynamic,
1028
- }
1029
- end
1030
-
1031
- def to_json(options = nil)
1032
- JSON.generate(to_dynamic, options)
1033
- end
1034
- end
1035
-
1036
- class ResponseForCreateSecretResponse < Dry::Struct
1037
-
1038
- # The response data. Populated if `success` is true.
1039
- attribute :data, CreateSecretResponse.optional.optional
1040
-
1041
- # A message for any error that may occur. Populated if `success` is false.
1042
- attribute :error_message, Types::String.optional.optional
1043
-
1044
- # Whether or not the SDK request succeeded.
1045
- attribute :success, Types::Bool
1046
-
1047
- def self.from_dynamic!(d)
1048
- d = Types::Hash[d]
1049
- new(
1050
- data: d["data"] ? CreateSecretResponse.from_dynamic!(d["data"]) : nil,
1051
- error_message: d["errorMessage"],
1052
- success: d.fetch("success"),
1053
- )
1054
- end
1055
-
1056
- def self.from_json!(json)
1057
- from_dynamic!(JSON.parse(json))
1058
- end
1059
-
1060
- def to_dynamic
1061
- {
1062
- "data" => data&.to_dynamic,
1063
- "errorMessage" => error_message,
1064
- "success" => success,
1065
- }
1066
- end
1067
-
1068
- def to_json(options = nil)
1069
- JSON.generate(to_dynamic, options)
1070
- end
1071
- end
1072
-
1073
- class CreateSymmetricKeyResponse < Dry::Struct
1074
- attribute :key, Types::String
1075
-
1076
- def self.from_dynamic!(d)
1077
- d = Types::Hash[d]
1078
- new(
1079
- key: d.fetch("key"),
1080
- )
1081
- end
1082
-
1083
- def self.from_json!(json)
1084
- from_dynamic!(JSON.parse(json))
1085
- end
1086
-
1087
- def to_dynamic
1088
- {
1089
- "key" => key,
1090
- }
1091
- end
1092
-
1093
- def to_json(options = nil)
1094
- JSON.generate(to_dynamic, options)
1095
- end
1096
- end
1097
-
1098
- class ResponseForCreateSymmetricKeyResponse < Dry::Struct
1099
-
1100
- # The response data. Populated if `success` is true.
1101
- attribute :data, CreateSymmetricKeyResponse.optional.optional
1102
-
1103
- # A message for any error that may occur. Populated if `success` is false.
1104
- attribute :error_message, Types::String.optional.optional
1105
-
1106
- # Whether or not the SDK request succeeded.
1107
- attribute :success, Types::Bool
1108
-
1109
- def self.from_dynamic!(d)
1110
- d = Types::Hash[d]
1111
- new(
1112
- data: d["data"] ? CreateSymmetricKeyResponse.from_dynamic!(d["data"]) : nil,
1113
- error_message: d["errorMessage"],
1114
- success: d.fetch("success"),
1115
- )
1116
- end
1117
-
1118
- def self.from_json!(json)
1119
- from_dynamic!(JSON.parse(json))
1120
- end
1121
-
1122
- def to_dynamic
1123
- {
1124
- "data" => data&.to_dynamic,
1125
- "errorMessage" => error_message,
1126
- "success" => success,
1127
- }
1128
- end
1129
-
1130
- def to_json(options = nil)
1131
- JSON.generate(to_dynamic, options)
1132
- end
1133
- end
1134
-
1135
- class DecryptSymmetricResponse < Dry::Struct
1136
- attribute :decrypted, Types::String
1137
-
1138
- def self.from_dynamic!(d)
1139
- d = Types::Hash[d]
1140
- new(
1141
- decrypted: d.fetch("decrypted"),
1142
- )
1143
- end
1144
-
1145
- def self.from_json!(json)
1146
- from_dynamic!(JSON.parse(json))
1147
- end
1148
-
1149
- def to_dynamic
1150
- {
1151
- "decrypted" => decrypted,
1152
- }
1153
- end
1154
-
1155
- def to_json(options = nil)
1156
- JSON.generate(to_dynamic, options)
1157
- end
1158
- end
1159
-
1160
- class ResponseForDecryptSymmetricResponse < Dry::Struct
1161
-
1162
- # The response data. Populated if `success` is true.
1163
- attribute :data, DecryptSymmetricResponse.optional.optional
1164
-
1165
- # A message for any error that may occur. Populated if `success` is false.
1166
- attribute :error_message, Types::String.optional.optional
1167
-
1168
- # Whether or not the SDK request succeeded.
1169
- attribute :success, Types::Bool
1170
-
1171
- def self.from_dynamic!(d)
1172
- d = Types::Hash[d]
1173
- new(
1174
- data: d["data"] ? DecryptSymmetricResponse.from_dynamic!(d["data"]) : nil,
1175
- error_message: d["errorMessage"],
1176
- success: d.fetch("success"),
1177
- )
1178
- end
1179
-
1180
- def self.from_json!(json)
1181
- from_dynamic!(JSON.parse(json))
1182
- end
1183
-
1184
- def to_dynamic
1185
- {
1186
- "data" => data&.to_dynamic,
1187
- "errorMessage" => error_message,
1188
- "success" => success,
1189
- }
1190
- end
1191
-
1192
- def to_json(options = nil)
1193
- JSON.generate(to_dynamic, options)
1194
- end
1195
- end
1196
-
1197
- class DeleteSecretResponseSecret < Dry::Struct
1198
- attribute :environment, Types::String
1199
- attribute :is_fallback, Types::Bool.optional
1200
- attribute :secret_comment, Types::String
1201
- attribute :secret_key, Types::String
1202
-
1203
- # The path of the secret.
1204
- #
1205
- # Note that this will only be present when using the `list secrets` method.
1206
- attribute :secret_path, Types::String.optional.optional
1207
-
1208
- attribute :secret_value, Types::String
1209
- attribute :secret_type, Types::String
1210
- attribute :version, Types::Integer
1211
- attribute :workspace, Types::String
1212
-
1213
- def self.from_dynamic!(d)
1214
- d = Types::Hash[d]
1215
- new(
1216
- environment: d.fetch("environment"),
1217
- is_fallback: d["isFallback"],
1218
- secret_comment: d.fetch("secretComment"),
1219
- secret_key: d.fetch("secretKey"),
1220
- secret_path: d["secretPath"],
1221
- secret_value: d.fetch("secretValue"),
1222
- secret_type: d.fetch("type"),
1223
- version: d.fetch("version"),
1224
- workspace: d.fetch("workspace"),
1225
- )
1226
- end
1227
-
1228
- def self.from_json!(json)
1229
- from_dynamic!(JSON.parse(json))
1230
- end
1231
-
1232
- def to_dynamic
1233
- {
1234
- "environment" => environment,
1235
- "isFallback" => is_fallback,
1236
- "secretComment" => secret_comment,
1237
- "secretKey" => secret_key,
1238
- "secretPath" => secret_path,
1239
- "secretValue" => secret_value,
1240
- "type" => secret_type,
1241
- "version" => version,
1242
- "workspace" => workspace,
1243
- }
1244
- end
1245
-
1246
- def to_json(options = nil)
1247
- JSON.generate(to_dynamic, options)
1248
- end
1249
- end
1250
-
1251
- class DeleteSecretResponse < Dry::Struct
1252
- attribute :secret, DeleteSecretResponseSecret
1253
-
1254
- def self.from_dynamic!(d)
1255
- d = Types::Hash[d]
1256
- new(
1257
- secret: DeleteSecretResponseSecret.from_dynamic!(d.fetch("secret")),
1258
- )
1259
- end
1260
-
1261
- def self.from_json!(json)
1262
- from_dynamic!(JSON.parse(json))
1263
- end
1264
-
1265
- def to_dynamic
1266
- {
1267
- "secret" => secret.to_dynamic,
1268
- }
1269
- end
1270
-
1271
- def to_json(options = nil)
1272
- JSON.generate(to_dynamic, options)
1273
- end
1274
- end
1275
-
1276
- class ResponseForDeleteSecretResponse < Dry::Struct
1277
-
1278
- # The response data. Populated if `success` is true.
1279
- attribute :data, DeleteSecretResponse.optional.optional
1280
-
1281
- # A message for any error that may occur. Populated if `success` is false.
1282
- attribute :error_message, Types::String.optional.optional
1283
-
1284
- # Whether or not the SDK request succeeded.
1285
- attribute :success, Types::Bool
1286
-
1287
- def self.from_dynamic!(d)
1288
- d = Types::Hash[d]
1289
- new(
1290
- data: d["data"] ? DeleteSecretResponse.from_dynamic!(d["data"]) : nil,
1291
- error_message: d["errorMessage"],
1292
- success: d.fetch("success"),
1293
- )
1294
- end
1295
-
1296
- def self.from_json!(json)
1297
- from_dynamic!(JSON.parse(json))
1298
- end
1299
-
1300
- def to_dynamic
1301
- {
1302
- "data" => data&.to_dynamic,
1303
- "errorMessage" => error_message,
1304
- "success" => success,
1305
- }
1306
- end
1307
-
1308
- def to_json(options = nil)
1309
- JSON.generate(to_dynamic, options)
1310
- end
1311
- end
1312
-
1313
- class EncryptSymmetricResponse < Dry::Struct
1314
- attribute :ciphertext, Types::String
1315
- attribute :iv, Types::String
1316
- attribute :tag, Types::String
1317
-
1318
- def self.from_dynamic!(d)
1319
- d = Types::Hash[d]
1320
- new(
1321
- ciphertext: d.fetch("ciphertext"),
1322
- iv: d.fetch("iv"),
1323
- tag: d.fetch("tag"),
1324
- )
1325
- end
1326
-
1327
- def self.from_json!(json)
1328
- from_dynamic!(JSON.parse(json))
1329
- end
1330
-
1331
- def to_dynamic
1332
- {
1333
- "ciphertext" => ciphertext,
1334
- "iv" => iv,
1335
- "tag" => tag,
1336
- }
1337
- end
1338
-
1339
- def to_json(options = nil)
1340
- JSON.generate(to_dynamic, options)
1341
- end
1342
- end
1343
-
1344
- class ResponseForEncryptSymmetricResponse < Dry::Struct
1345
-
1346
- # The response data. Populated if `success` is true.
1347
- attribute :data, EncryptSymmetricResponse.optional.optional
1348
-
1349
- # A message for any error that may occur. Populated if `success` is false.
1350
- attribute :error_message, Types::String.optional.optional
1351
-
1352
- # Whether or not the SDK request succeeded.
1353
- attribute :success, Types::Bool
1354
-
1355
- def self.from_dynamic!(d)
1356
- d = Types::Hash[d]
1357
- new(
1358
- data: d["data"] ? EncryptSymmetricResponse.from_dynamic!(d["data"]) : nil,
1359
- error_message: d["errorMessage"],
1360
- success: d.fetch("success"),
1361
- )
1362
- end
1363
-
1364
- def self.from_json!(json)
1365
- from_dynamic!(JSON.parse(json))
1366
- end
1367
-
1368
- def to_dynamic
1369
- {
1370
- "data" => data&.to_dynamic,
1371
- "errorMessage" => error_message,
1372
- "success" => success,
1373
- }
1374
- end
1375
-
1376
- def to_json(options = nil)
1377
- JSON.generate(to_dynamic, options)
1378
- end
1379
- end
1380
-
1381
- class GetSecretResponseSecret < Dry::Struct
1382
- attribute :environment, Types::String
1383
- attribute :is_fallback, Types::Bool.optional
1384
- attribute :secret_comment, Types::String
1385
- attribute :secret_key, Types::String
1386
-
1387
- # The path of the secret.
1388
- #
1389
- # Note that this will only be present when using the `list secrets` method.
1390
- attribute :secret_path, Types::String.optional.optional
1391
-
1392
- attribute :secret_value, Types::String
1393
- attribute :secret_type, Types::String
1394
- attribute :version, Types::Integer
1395
- attribute :workspace, Types::String
1396
-
1397
- def self.from_dynamic!(d)
1398
- d = Types::Hash[d]
1399
- new(
1400
- environment: d.fetch("environment"),
1401
- is_fallback: d["isFallback"],
1402
- secret_comment: d.fetch("secretComment"),
1403
- secret_key: d.fetch("secretKey"),
1404
- secret_path: d["secretPath"],
1405
- secret_value: d.fetch("secretValue"),
1406
- secret_type: d.fetch("type"),
1407
- version: d.fetch("version"),
1408
- workspace: d.fetch("workspace"),
1409
- )
1410
- end
1411
-
1412
- def self.from_json!(json)
1413
- from_dynamic!(JSON.parse(json))
1414
- end
1415
-
1416
- def to_dynamic
1417
- {
1418
- "environment" => environment,
1419
- "isFallback" => is_fallback,
1420
- "secretComment" => secret_comment,
1421
- "secretKey" => secret_key,
1422
- "secretPath" => secret_path,
1423
- "secretValue" => secret_value,
1424
- "type" => secret_type,
1425
- "version" => version,
1426
- "workspace" => workspace,
1427
- }
1428
- end
1429
-
1430
- def to_json(options = nil)
1431
- JSON.generate(to_dynamic, options)
1432
- end
1433
- end
1434
-
1435
- class GetSecretResponse < Dry::Struct
1436
- attribute :secret, GetSecretResponseSecret
1437
-
1438
- def self.from_dynamic!(d)
1439
- d = Types::Hash[d]
1440
- new(
1441
- secret: GetSecretResponseSecret.from_dynamic!(d.fetch("secret")),
1442
- )
1443
- end
1444
-
1445
- def self.from_json!(json)
1446
- from_dynamic!(JSON.parse(json))
1447
- end
1448
-
1449
- def to_dynamic
1450
- {
1451
- "secret" => secret.to_dynamic,
1452
- }
1453
- end
1454
-
1455
- def to_json(options = nil)
1456
- JSON.generate(to_dynamic, options)
1457
- end
1458
- end
1459
-
1460
- class ResponseForGetSecretResponse < Dry::Struct
1461
-
1462
- # The response data. Populated if `success` is true.
1463
- attribute :data, GetSecretResponse.optional.optional
1464
-
1465
- # A message for any error that may occur. Populated if `success` is false.
1466
- attribute :error_message, Types::String.optional.optional
1467
-
1468
- # Whether or not the SDK request succeeded.
1469
- attribute :success, Types::Bool
1470
-
1471
- def self.from_dynamic!(d)
1472
- d = Types::Hash[d]
1473
- new(
1474
- data: d["data"] ? GetSecretResponse.from_dynamic!(d["data"]) : nil,
1475
- error_message: d["errorMessage"],
1476
- success: d.fetch("success"),
1477
- )
1478
- end
1479
-
1480
- def self.from_json!(json)
1481
- from_dynamic!(JSON.parse(json))
1482
- end
1483
-
1484
- def to_dynamic
1485
- {
1486
- "data" => data&.to_dynamic,
1487
- "errorMessage" => error_message,
1488
- "success" => success,
1489
- }
1490
- end
1491
-
1492
- def to_json(options = nil)
1493
- JSON.generate(to_dynamic, options)
1494
- end
1495
- end
1496
-
1497
- class SecretElement < Dry::Struct
1498
- attribute :environment, Types::String
1499
- attribute :is_fallback, Types::Bool.optional
1500
- attribute :secret_comment, Types::String
1501
- attribute :secret_key, Types::String
1502
-
1503
- # The path of the secret.
1504
- #
1505
- # Note that this will only be present when using the `list secrets` method.
1506
- attribute :secret_path, Types::String.optional.optional
1507
-
1508
- attribute :secret_value, Types::String
1509
- attribute :secret_type, Types::String
1510
- attribute :version, Types::Integer
1511
- attribute :workspace, Types::String
1512
-
1513
- def self.from_dynamic!(d)
1514
- d = Types::Hash[d]
1515
- new(
1516
- environment: d.fetch("environment"),
1517
- is_fallback: d["isFallback"],
1518
- secret_comment: d.fetch("secretComment"),
1519
- secret_key: d.fetch("secretKey"),
1520
- secret_path: d["secretPath"],
1521
- secret_value: d.fetch("secretValue"),
1522
- secret_type: d.fetch("type"),
1523
- version: d.fetch("version"),
1524
- workspace: d.fetch("workspace"),
1525
- )
1526
- end
1527
-
1528
- def self.from_json!(json)
1529
- from_dynamic!(JSON.parse(json))
1530
- end
1531
-
1532
- def to_dynamic
1533
- {
1534
- "environment" => environment,
1535
- "isFallback" => is_fallback,
1536
- "secretComment" => secret_comment,
1537
- "secretKey" => secret_key,
1538
- "secretPath" => secret_path,
1539
- "secretValue" => secret_value,
1540
- "type" => secret_type,
1541
- "version" => version,
1542
- "workspace" => workspace,
1543
- }
1544
- end
1545
-
1546
- def to_json(options = nil)
1547
- JSON.generate(to_dynamic, options)
1548
- end
1549
- end
1550
-
1551
- class ListSecretsResponse < Dry::Struct
1552
- attribute :secrets, Types.Array(SecretElement)
1553
-
1554
- def self.from_dynamic!(d)
1555
- d = Types::Hash[d]
1556
- new(
1557
- secrets: d.fetch("secrets").map { |x| SecretElement.from_dynamic!(x) },
1558
- )
1559
- end
1560
-
1561
- def self.from_json!(json)
1562
- from_dynamic!(JSON.parse(json))
1563
- end
1564
-
1565
- def to_dynamic
1566
- {
1567
- "secrets" => secrets.map { |x| x.to_dynamic },
1568
- }
1569
- end
1570
-
1571
- def to_json(options = nil)
1572
- JSON.generate(to_dynamic, options)
1573
- end
1574
- end
1575
-
1576
- class ResponseForListSecretsResponse < Dry::Struct
1577
-
1578
- # The response data. Populated if `success` is true.
1579
- attribute :data, ListSecretsResponse.optional.optional
1580
-
1581
- # A message for any error that may occur. Populated if `success` is false.
1582
- attribute :error_message, Types::String.optional.optional
1583
-
1584
- # Whether or not the SDK request succeeded.
1585
- attribute :success, Types::Bool
1586
-
1587
- def self.from_dynamic!(d)
1588
- d = Types::Hash[d]
1589
- new(
1590
- data: d["data"] ? ListSecretsResponse.from_dynamic!(d["data"]) : nil,
1591
- error_message: d["errorMessage"],
1592
- success: d.fetch("success"),
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
- "data" => data&.to_dynamic,
1603
- "errorMessage" => error_message,
1604
- "success" => success,
1605
- }
1606
- end
1607
-
1608
- def to_json(options = nil)
1609
- JSON.generate(to_dynamic, options)
1610
- end
1611
- end
1612
-
1613
- class UpdateSecretResponseSecret < Dry::Struct
1614
- attribute :environment, Types::String
1615
- attribute :is_fallback, Types::Bool.optional
1616
- attribute :secret_comment, Types::String
1617
- attribute :secret_key, Types::String
1618
-
1619
- # The path of the secret.
1620
- #
1621
- # Note that this will only be present when using the `list secrets` method.
1622
- attribute :secret_path, Types::String.optional.optional
1623
-
1624
- attribute :secret_value, Types::String
1625
- attribute :secret_type, Types::String
1626
- attribute :version, Types::Integer
1627
- attribute :workspace, Types::String
1628
-
1629
- def self.from_dynamic!(d)
1630
- d = Types::Hash[d]
1631
- new(
1632
- environment: d.fetch("environment"),
1633
- is_fallback: d["isFallback"],
1634
- secret_comment: d.fetch("secretComment"),
1635
- secret_key: d.fetch("secretKey"),
1636
- secret_path: d["secretPath"],
1637
- secret_value: d.fetch("secretValue"),
1638
- secret_type: d.fetch("type"),
1639
- version: d.fetch("version"),
1640
- workspace: d.fetch("workspace"),
1641
- )
1642
- end
1643
-
1644
- def self.from_json!(json)
1645
- from_dynamic!(JSON.parse(json))
1646
- end
1647
-
1648
- def to_dynamic
1649
- {
1650
- "environment" => environment,
1651
- "isFallback" => is_fallback,
1652
- "secretComment" => secret_comment,
1653
- "secretKey" => secret_key,
1654
- "secretPath" => secret_path,
1655
- "secretValue" => secret_value,
1656
- "type" => secret_type,
1657
- "version" => version,
1658
- "workspace" => workspace,
1659
- }
1660
- end
1661
-
1662
- def to_json(options = nil)
1663
- JSON.generate(to_dynamic, options)
1664
- end
1665
- end
1666
-
1667
- class UpdateSecretResponse < Dry::Struct
1668
- attribute :secret, UpdateSecretResponseSecret
1669
-
1670
- def self.from_dynamic!(d)
1671
- d = Types::Hash[d]
1672
- new(
1673
- secret: UpdateSecretResponseSecret.from_dynamic!(d.fetch("secret")),
1674
- )
1675
- end
1676
-
1677
- def self.from_json!(json)
1678
- from_dynamic!(JSON.parse(json))
1679
- end
1680
-
1681
- def to_dynamic
1682
- {
1683
- "secret" => secret.to_dynamic,
1684
- }
1685
- end
1686
-
1687
- def to_json(options = nil)
1688
- JSON.generate(to_dynamic, options)
1689
- end
1690
- end
1691
-
1692
- class ResponseForUpdateSecretResponse < Dry::Struct
1693
-
1694
- # The response data. Populated if `success` is true.
1695
- attribute :data, UpdateSecretResponse.optional.optional
1696
-
1697
- # A message for any error that may occur. Populated if `success` is false.
1698
- attribute :error_message, Types::String.optional.optional
1699
-
1700
- # Whether or not the SDK request succeeded.
1701
- attribute :success, Types::Bool
1702
-
1703
- def self.from_dynamic!(d)
1704
- d = Types::Hash[d]
1705
- new(
1706
- data: d["data"] ? UpdateSecretResponse.from_dynamic!(d["data"]) : nil,
1707
- error_message: d["errorMessage"],
1708
- success: d.fetch("success"),
1709
- )
1710
- end
1711
-
1712
- def self.from_json!(json)
1713
- from_dynamic!(JSON.parse(json))
1714
- end
1715
-
1716
- def to_dynamic
1717
- {
1718
- "data" => data&.to_dynamic,
1719
- "errorMessage" => error_message,
1720
- "success" => success,
1721
- }
1722
- end
1723
-
1724
- def to_json(options = nil)
1725
- JSON.generate(to_dynamic, options)
1726
- end
1727
- end
1728
-