forked from googleapis/google-api-go-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudkms-gen.go
5944 lines (5466 loc) · 212 KB
/
cloudkms-gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Package cloudkms provides access to the Cloud Key Management Service (KMS) API.
//
// This package is DEPRECATED. Use package cloud.google.com/go/kms/apiv1 instead.
//
// See https://cloud.google.com/kms/
//
// Usage example:
//
// import "google.golang.org/api/cloudkms/v1"
// ...
// cloudkmsService, err := cloudkms.New(oauthHttpClient)
package cloudkms // import "google.golang.org/api/cloudkms/v1"
import (
"bytes"
"encoding/json"
"errors"
"fmt"
context "golang.org/x/net/context"
ctxhttp "golang.org/x/net/context/ctxhttp"
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = ctxhttp.Do
const apiId = "cloudkms:v1"
const apiName = "cloudkms"
const apiVersion = "v1"
const basePath = "https://cloudkms.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// View and manage your data across Google Cloud Platform services
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Projects = NewProjectsService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Projects *ProjectsService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewProjectsService(s *Service) *ProjectsService {
rs := &ProjectsService{s: s}
rs.Locations = NewProjectsLocationsService(s)
return rs
}
type ProjectsService struct {
s *Service
Locations *ProjectsLocationsService
}
func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
rs := &ProjectsLocationsService{s: s}
rs.KeyRings = NewProjectsLocationsKeyRingsService(s)
return rs
}
type ProjectsLocationsService struct {
s *Service
KeyRings *ProjectsLocationsKeyRingsService
}
func NewProjectsLocationsKeyRingsService(s *Service) *ProjectsLocationsKeyRingsService {
rs := &ProjectsLocationsKeyRingsService{s: s}
rs.CryptoKeys = NewProjectsLocationsKeyRingsCryptoKeysService(s)
return rs
}
type ProjectsLocationsKeyRingsService struct {
s *Service
CryptoKeys *ProjectsLocationsKeyRingsCryptoKeysService
}
func NewProjectsLocationsKeyRingsCryptoKeysService(s *Service) *ProjectsLocationsKeyRingsCryptoKeysService {
rs := &ProjectsLocationsKeyRingsCryptoKeysService{s: s}
rs.CryptoKeyVersions = NewProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService(s)
return rs
}
type ProjectsLocationsKeyRingsCryptoKeysService struct {
s *Service
CryptoKeyVersions *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService
}
func NewProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService(s *Service) *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService {
rs := &ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService{s: s}
return rs
}
type ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsService struct {
s *Service
}
// AsymmetricDecryptRequest: Request message for
// KeyManagementService.AsymmetricDecrypt.
type AsymmetricDecryptRequest struct {
// Ciphertext: Required. The data encrypted with the named
// CryptoKeyVersion's public
// key using OAEP.
Ciphertext string `json:"ciphertext,omitempty"`
// ForceSendFields is a list of field names (e.g. "Ciphertext") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Ciphertext") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AsymmetricDecryptRequest) MarshalJSON() ([]byte, error) {
type NoMethod AsymmetricDecryptRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AsymmetricDecryptResponse: Response message for
// KeyManagementService.AsymmetricDecrypt.
type AsymmetricDecryptResponse struct {
// Plaintext: The decrypted data originally encrypted with the matching
// public key.
Plaintext string `json:"plaintext,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Plaintext") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Plaintext") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AsymmetricDecryptResponse) MarshalJSON() ([]byte, error) {
type NoMethod AsymmetricDecryptResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AsymmetricSignRequest: Request message for
// KeyManagementService.AsymmetricSign.
type AsymmetricSignRequest struct {
// Digest: Required. The digest of the data to sign. The digest must be
// produced with
// the same digest algorithm as specified by the key
// version's
// algorithm.
Digest *Digest `json:"digest,omitempty"`
// ForceSendFields is a list of field names (e.g. "Digest") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Digest") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AsymmetricSignRequest) MarshalJSON() ([]byte, error) {
type NoMethod AsymmetricSignRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AsymmetricSignResponse: Response message for
// KeyManagementService.AsymmetricSign.
type AsymmetricSignResponse struct {
// Signature: The created signature.
Signature string `json:"signature,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Signature") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Signature") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AsymmetricSignResponse) MarshalJSON() ([]byte, error) {
type NoMethod AsymmetricSignResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AuditConfig: Specifies the audit configuration for a service.
// The configuration determines which permission types are logged, and
// what
// identities, if any, are exempted from logging.
// An AuditConfig must have one or more AuditLogConfigs.
//
// If there are AuditConfigs for both `allServices` and a specific
// service,
// the union of the two AuditConfigs is used for that service: the
// log_types
// specified in each AuditConfig are enabled, and the exempted_members
// in each
// AuditLogConfig are exempted.
//
// Example Policy with multiple AuditConfigs:
//
// {
// "audit_configs": [
// {
// "service": "allServices"
// "audit_log_configs": [
// {
// "log_type": "DATA_READ",
// "exempted_members": [
// "user:[email protected]"
// ]
// },
// {
// "log_type": "DATA_WRITE",
// },
// {
// "log_type": "ADMIN_READ",
// }
// ]
// },
// {
// "service": "fooservice.googleapis.com"
// "audit_log_configs": [
// {
// "log_type": "DATA_READ",
// },
// {
// "log_type": "DATA_WRITE",
// "exempted_members": [
// "user:[email protected]"
// ]
// }
// ]
// }
// ]
// }
//
// For fooservice, this policy enables DATA_READ, DATA_WRITE and
// ADMIN_READ
// logging. It also exempts [email protected] from DATA_READ logging,
// and
// [email protected] from DATA_WRITE logging.
type AuditConfig struct {
// AuditLogConfigs: The configuration for logging of each type of
// permission.
AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
// Service: Specifies a service that will be enabled for audit
// logging.
// For example, `storage.googleapis.com`,
// `cloudsql.googleapis.com`.
// `allServices` is a special value that covers all services.
Service string `json:"service,omitempty"`
// ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AuditLogConfigs") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *AuditConfig) MarshalJSON() ([]byte, error) {
type NoMethod AuditConfig
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AuditLogConfig: Provides the configuration for logging a type of
// permissions.
// Example:
//
// {
// "audit_log_configs": [
// {
// "log_type": "DATA_READ",
// "exempted_members": [
// "user:[email protected]"
// ]
// },
// {
// "log_type": "DATA_WRITE",
// }
// ]
// }
//
// This enables 'DATA_READ' and 'DATA_WRITE' logging, while
// exempting
// [email protected] from DATA_READ logging.
type AuditLogConfig struct {
// ExemptedMembers: Specifies the identities that do not cause logging
// for this type of
// permission.
// Follows the same format of Binding.members.
ExemptedMembers []string `json:"exemptedMembers,omitempty"`
// LogType: The log type that this config enables.
//
// Possible values:
// "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
// "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
// "DATA_WRITE" - Data writes. Example: CloudSQL Users create
// "DATA_READ" - Data reads. Example: CloudSQL Users list
LogType string `json:"logType,omitempty"`
// ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ExemptedMembers") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
type NoMethod AuditLogConfig
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Binding: Associates `members` with a `role`.
type Binding struct {
// Condition: Unimplemented. The condition that is associated with this
// binding.
// NOTE: an unsatisfied condition will not allow user access via
// current
// binding. Different bindings, including their conditions, are
// examined
// independently.
Condition *Expr `json:"condition,omitempty"`
// Members: Specifies the identities requesting access for a Cloud
// Platform resource.
// `members` can have the following values:
//
// * `allUsers`: A special identifier that represents anyone who is
// on the internet; with or without a Google account.
//
// * `allAuthenticatedUsers`: A special identifier that represents
// anyone
// who is authenticated with a Google account or a service
// account.
//
// * `user:{emailid}`: An email address that represents a specific
// Google
// account. For example, `[email protected]` .
//
//
// * `serviceAccount:{emailid}`: An email address that represents a
// service
// account. For example,
// `[email protected]`.
//
// * `group:{emailid}`: An email address that represents a Google
// group.
// For example, `[email protected]`.
//
//
// * `domain:{domain}`: A Google Apps domain name that represents all
// the
// users of that domain. For example, `google.com` or
// `example.com`.
//
//
Members []string `json:"members,omitempty"`
// Role: Role that is assigned to `members`.
// For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Role string `json:"role,omitempty"`
// ForceSendFields is a list of field names (e.g. "Condition") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Condition") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Binding) MarshalJSON() ([]byte, error) {
type NoMethod Binding
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CryptoKey: A CryptoKey represents a logical key that can be used for
// cryptographic
// operations.
//
// A CryptoKey is made up of one or more versions, which
// represent the actual key material used in cryptographic operations.
type CryptoKey struct {
// CreateTime: Output only. The time at which this CryptoKey was
// created.
CreateTime string `json:"createTime,omitempty"`
// Labels: Labels with user-defined metadata. For more information,
// see
// [Labeling Keys](/kms/docs/labeling-keys).
Labels map[string]string `json:"labels,omitempty"`
// Name: Output only. The resource name for this CryptoKey in the
// format
// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
Name string `json:"name,omitempty"`
// NextRotationTime: At next_rotation_time, the Key Management Service
// will automatically:
//
// 1. Create a new version of this CryptoKey.
// 2. Mark the new version as primary.
//
// Key rotations performed manually via
// CreateCryptoKeyVersion and
// UpdateCryptoKeyPrimaryVersion
// do not affect next_rotation_time.
//
// Keys with purpose
// ENCRYPT_DECRYPT support
// automatic rotation. For other keys, this field must be omitted.
NextRotationTime string `json:"nextRotationTime,omitempty"`
// Primary: Output only. A copy of the "primary" CryptoKeyVersion that
// will be used
// by Encrypt when this CryptoKey is given
// in EncryptRequest.name.
//
// The CryptoKey's primary version can be updated
// via
// UpdateCryptoKeyPrimaryVersion.
//
// All keys with purpose
// ENCRYPT_DECRYPT have a
// primary. For other keys, this field will be omitted.
Primary *CryptoKeyVersion `json:"primary,omitempty"`
// Purpose: The immutable purpose of this CryptoKey.
//
// Possible values:
// "CRYPTO_KEY_PURPOSE_UNSPECIFIED" - Not specified.
// "ENCRYPT_DECRYPT" - CryptoKeys with this purpose may be used
// with
// Encrypt and
// Decrypt.
// "ASYMMETRIC_SIGN" - CryptoKeys with this purpose may be used
// with
// AsymmetricSign and
// GetPublicKey.
// "ASYMMETRIC_DECRYPT" - CryptoKeys with this purpose may be used
// with
// AsymmetricDecrypt and
// GetPublicKey.
Purpose string `json:"purpose,omitempty"`
// RotationPeriod: next_rotation_time will be advanced by this period
// when the service
// automatically rotates a key. Must be at least one day.
//
// If rotation_period is set, next_rotation_time must also be set.
//
// Keys with purpose
// ENCRYPT_DECRYPT support
// automatic rotation. For other keys, this field must be omitted.
RotationPeriod string `json:"rotationPeriod,omitempty"`
// VersionTemplate: A template describing settings for new
// CryptoKeyVersion instances.
// The properties of new CryptoKeyVersion instances created by
// either
// CreateCryptoKeyVersion or
// auto-rotation are controlled by this template.
VersionTemplate *CryptoKeyVersionTemplate `json:"versionTemplate,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "CreateTime") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CreateTime") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CryptoKey) MarshalJSON() ([]byte, error) {
type NoMethod CryptoKey
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CryptoKeyVersion: A CryptoKeyVersion represents an individual
// cryptographic key, and the
// associated key material.
//
// An ENABLED version can be
// used for cryptographic operations.
//
// For security reasons, the raw cryptographic key material represented
// by a
// CryptoKeyVersion can never be viewed or exported. It can only be used
// to
// encrypt, decrypt, or sign data when an authorized user or application
// invokes
// Cloud KMS.
type CryptoKeyVersion struct {
// Algorithm: Output only. The CryptoKeyVersionAlgorithm that
// this
// CryptoKeyVersion supports.
//
// Possible values:
// "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED" - Not specified.
// "GOOGLE_SYMMETRIC_ENCRYPTION" - Creates symmetric encryption keys.
// "RSA_SIGN_PSS_2048_SHA256" - RSASSA-PSS 2048 bit key with a SHA256
// digest.
// "RSA_SIGN_PSS_3072_SHA256" - RSASSA-PSS 3072 bit key with a SHA256
// digest.
// "RSA_SIGN_PSS_4096_SHA256" - RSASSA-PSS 4096 bit key with a SHA256
// digest.
// "RSA_SIGN_PSS_4096_SHA512" - RSASSA-PSS 4096 bit key with a SHA512
// digest.
// "RSA_SIGN_PKCS1_2048_SHA256" - RSASSA-PKCS1-v1_5 with a 2048 bit
// key and a SHA256 digest.
// "RSA_SIGN_PKCS1_3072_SHA256" - RSASSA-PKCS1-v1_5 with a 3072 bit
// key and a SHA256 digest.
// "RSA_SIGN_PKCS1_4096_SHA256" - RSASSA-PKCS1-v1_5 with a 4096 bit
// key and a SHA256 digest.
// "RSA_SIGN_PKCS1_4096_SHA512" - RSASSA-PKCS1-v1_5 with a 4096 bit
// key and a SHA512 digest.
// "RSA_DECRYPT_OAEP_2048_SHA256" - RSAES-OAEP 2048 bit key with a
// SHA256 digest.
// "RSA_DECRYPT_OAEP_3072_SHA256" - RSAES-OAEP 3072 bit key with a
// SHA256 digest.
// "RSA_DECRYPT_OAEP_4096_SHA256" - RSAES-OAEP 4096 bit key with a
// SHA256 digest.
// "RSA_DECRYPT_OAEP_4096_SHA512" - RSAES-OAEP 4096 bit key with a
// SHA512 digest.
// "EC_SIGN_P256_SHA256" - ECDSA on the NIST P-256 curve with a SHA256
// digest.
// "EC_SIGN_P384_SHA384" - ECDSA on the NIST P-384 curve with a SHA384
// digest.
Algorithm string `json:"algorithm,omitempty"`
// Attestation: Output only. Statement that was generated and signed by
// the HSM at key
// creation time. Use this statement to verify attributes of the key as
// stored
// on the HSM, independently of Google. Only provided for key versions
// with
// protection_level HSM.
Attestation *KeyOperationAttestation `json:"attestation,omitempty"`
// CreateTime: Output only. The time at which this CryptoKeyVersion was
// created.
CreateTime string `json:"createTime,omitempty"`
// DestroyEventTime: Output only. The time this CryptoKeyVersion's key
// material was
// destroyed. Only present if state is
// DESTROYED.
DestroyEventTime string `json:"destroyEventTime,omitempty"`
// DestroyTime: Output only. The time this CryptoKeyVersion's key
// material is scheduled
// for destruction. Only present if state is
// DESTROY_SCHEDULED.
DestroyTime string `json:"destroyTime,omitempty"`
// GenerateTime: Output only. The time this CryptoKeyVersion's key
// material was
// generated.
GenerateTime string `json:"generateTime,omitempty"`
// Name: Output only. The resource name for this CryptoKeyVersion in the
// format
// `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersio
// ns/*`.
Name string `json:"name,omitempty"`
// ProtectionLevel: Output only. The ProtectionLevel describing how
// crypto operations are
// performed with this CryptoKeyVersion.
//
// Possible values:
// "PROTECTION_LEVEL_UNSPECIFIED" - Not specified.
// "SOFTWARE" - Crypto operations are performed in software.
// "HSM" - Crypto operations are performed in a Hardware Security
// Module.
ProtectionLevel string `json:"protectionLevel,omitempty"`
// State: The current state of the CryptoKeyVersion.
//
// Possible values:
// "CRYPTO_KEY_VERSION_STATE_UNSPECIFIED" - Not specified.
// "PENDING_GENERATION" - This version is still being generated. It
// may not be used, enabled,
// disabled, or destroyed yet. Cloud KMS will automatically mark
// this
// version ENABLED as soon as the version is ready.
// "ENABLED" - This version may be used for cryptographic operations.
// "DISABLED" - This version may not be used, but the key material is
// still available,
// and the version can be placed back into the ENABLED state.
// "DESTROYED" - This version is destroyed, and the key material is no
// longer stored.
// A version may not leave this state once entered.
// "DESTROY_SCHEDULED" - This version is scheduled for destruction,
// and will be destroyed soon.
// Call
// RestoreCryptoKeyVersion
// to put it back into the DISABLED state.
State string `json:"state,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Algorithm") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Algorithm") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CryptoKeyVersion) MarshalJSON() ([]byte, error) {
type NoMethod CryptoKeyVersion
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CryptoKeyVersionTemplate: A CryptoKeyVersionTemplate specifies the
// properties to use when creating
// a new CryptoKeyVersion, either manually with
// CreateCryptoKeyVersion or
// automatically as a result of auto-rotation.
type CryptoKeyVersionTemplate struct {
// Algorithm: Required. Algorithm to use
// when creating a CryptoKeyVersion based on this template.
//
// For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied
// if both
// this field is omitted and CryptoKey.purpose is
// ENCRYPT_DECRYPT.
//
// Possible values:
// "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED" - Not specified.
// "GOOGLE_SYMMETRIC_ENCRYPTION" - Creates symmetric encryption keys.
// "RSA_SIGN_PSS_2048_SHA256" - RSASSA-PSS 2048 bit key with a SHA256
// digest.
// "RSA_SIGN_PSS_3072_SHA256" - RSASSA-PSS 3072 bit key with a SHA256
// digest.
// "RSA_SIGN_PSS_4096_SHA256" - RSASSA-PSS 4096 bit key with a SHA256
// digest.
// "RSA_SIGN_PSS_4096_SHA512" - RSASSA-PSS 4096 bit key with a SHA512
// digest.
// "RSA_SIGN_PKCS1_2048_SHA256" - RSASSA-PKCS1-v1_5 with a 2048 bit
// key and a SHA256 digest.
// "RSA_SIGN_PKCS1_3072_SHA256" - RSASSA-PKCS1-v1_5 with a 3072 bit
// key and a SHA256 digest.
// "RSA_SIGN_PKCS1_4096_SHA256" - RSASSA-PKCS1-v1_5 with a 4096 bit
// key and a SHA256 digest.
// "RSA_SIGN_PKCS1_4096_SHA512" - RSASSA-PKCS1-v1_5 with a 4096 bit
// key and a SHA512 digest.
// "RSA_DECRYPT_OAEP_2048_SHA256" - RSAES-OAEP 2048 bit key with a
// SHA256 digest.
// "RSA_DECRYPT_OAEP_3072_SHA256" - RSAES-OAEP 3072 bit key with a
// SHA256 digest.
// "RSA_DECRYPT_OAEP_4096_SHA256" - RSAES-OAEP 4096 bit key with a
// SHA256 digest.
// "RSA_DECRYPT_OAEP_4096_SHA512" - RSAES-OAEP 4096 bit key with a
// SHA512 digest.
// "EC_SIGN_P256_SHA256" - ECDSA on the NIST P-256 curve with a SHA256
// digest.
// "EC_SIGN_P384_SHA384" - ECDSA on the NIST P-384 curve with a SHA384
// digest.
Algorithm string `json:"algorithm,omitempty"`
// ProtectionLevel: ProtectionLevel to use when creating a
// CryptoKeyVersion based on
// this template. Immutable. Defaults to SOFTWARE.
//
// Possible values:
// "PROTECTION_LEVEL_UNSPECIFIED" - Not specified.
// "SOFTWARE" - Crypto operations are performed in software.
// "HSM" - Crypto operations are performed in a Hardware Security
// Module.
ProtectionLevel string `json:"protectionLevel,omitempty"`
// ForceSendFields is a list of field names (e.g. "Algorithm") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Algorithm") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CryptoKeyVersionTemplate) MarshalJSON() ([]byte, error) {
type NoMethod CryptoKeyVersionTemplate
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DecryptRequest: Request message for KeyManagementService.Decrypt.
type DecryptRequest struct {
// AdditionalAuthenticatedData: Optional data that must match the data
// originally supplied in
// EncryptRequest.additional_authenticated_data.
AdditionalAuthenticatedData string `json:"additionalAuthenticatedData,omitempty"`
// Ciphertext: Required. The encrypted data originally returned
// in
// EncryptResponse.ciphertext.
Ciphertext string `json:"ciphertext,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "AdditionalAuthenticatedData") to unconditionally include in API
// requests. By default, fields with empty values are omitted from API
// requests. However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g.
// "AdditionalAuthenticatedData") to include in API requests with the
// JSON null value. By default, fields with empty values are omitted
// from API requests. However, any field with an empty value appearing
// in NullFields will be sent to the server as null. It is an error if a
// field in this list has a non-empty value. This may be used to include
// null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *DecryptRequest) MarshalJSON() ([]byte, error) {
type NoMethod DecryptRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DecryptResponse: Response message for KeyManagementService.Decrypt.
type DecryptResponse struct {
// Plaintext: The decrypted data originally supplied in
// EncryptRequest.plaintext.
Plaintext string `json:"plaintext,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Plaintext") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Plaintext") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *DecryptResponse) MarshalJSON() ([]byte, error) {
type NoMethod DecryptResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DestroyCryptoKeyVersionRequest: Request message for
// KeyManagementService.DestroyCryptoKeyVersion.
type DestroyCryptoKeyVersionRequest struct {
}
// Digest: A Digest holds a cryptographic message digest.
type Digest struct {
// Sha256: A message digest produced with the SHA-256 algorithm.
Sha256 string `json:"sha256,omitempty"`
// Sha384: A message digest produced with the SHA-384 algorithm.
Sha384 string `json:"sha384,omitempty"`
// Sha512: A message digest produced with the SHA-512 algorithm.
Sha512 string `json:"sha512,omitempty"`
// ForceSendFields is a list of field names (e.g. "Sha256") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Sha256") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Digest) MarshalJSON() ([]byte, error) {
type NoMethod Digest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// EncryptRequest: Request message for KeyManagementService.Encrypt.
type EncryptRequest struct {
// AdditionalAuthenticatedData: Optional data that, if specified, must
// also be provided during decryption
// through DecryptRequest.additional_authenticated_data.
//
// The maximum size depends on the key version's
// protection_level. For
// SOFTWARE keys, the AAD must be no larger than
// 64KiB. For HSM keys, the combined length of the
// plaintext and additional_authenticated_data fields must be no larger
// than
// 8KiB.
AdditionalAuthenticatedData string `json:"additionalAuthenticatedData,omitempty"`
// Plaintext: Required. The data to encrypt. Must be no larger than
// 64KiB.
//
// The maximum size depends on the key version's
// protection_level. For
// SOFTWARE keys, the plaintext must be no larger
// than 64KiB. For HSM keys, the combined length of the
// plaintext and additional_authenticated_data fields must be no larger
// than
// 8KiB.
Plaintext string `json:"plaintext,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "AdditionalAuthenticatedData") to unconditionally include in API
// requests. By default, fields with empty values are omitted from API
// requests. However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g.
// "AdditionalAuthenticatedData") to include in API requests with the
// JSON null value. By default, fields with empty values are omitted
// from API requests. However, any field with an empty value appearing
// in NullFields will be sent to the server as null. It is an error if a
// field in this list has a non-empty value. This may be used to include
// null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *EncryptRequest) MarshalJSON() ([]byte, error) {
type NoMethod EncryptRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}