@@ -70,7 +70,7 @@ type BeginCreateCertificateOptions struct {
70
70
Enabled * bool `json:"enabled,omitempty"`
71
71
72
72
// Application specific metadata in the form of key-value pairs
73
- Tags map [string ]string `json:"tags,omitempty"`
73
+ Tags map [string ]* string `json:"tags,omitempty"`
74
74
75
75
// ResumeToken is a token for resuming long running operations from a previous poller
76
76
ResumeToken string
@@ -91,11 +91,6 @@ func (c *Client) BeginCreateCertificate(ctx context.Context, certificateName str
91
91
options = & BeginCreateCertificateOptions {}
92
92
}
93
93
94
- var tags map [string ]* string
95
- if options .Tags != nil {
96
- tags = convertToGeneratedMap (options .Tags )
97
- }
98
-
99
94
handler := beginCreateCertificateOperation {
100
95
poll : func (ctx context.Context , endpoint string ) (* http.Response , error ) {
101
96
req , err := runtime .NewRequest (ctx , http .MethodGet , endpoint )
@@ -127,7 +122,7 @@ func (c *Client) BeginCreateCertificate(ctx context.Context, certificateName str
127
122
certificateName ,
128
123
generated.CertificateCreateParameters {
129
124
CertificatePolicy : policy .toGeneratedCertificateCreateParameters (),
130
- Tags : tags ,
125
+ Tags : options . Tags ,
131
126
CertificateAttributes : & generated.CertificateAttributes {Enabled : options .Enabled },
132
127
},
133
128
options .toGenerated (),
@@ -170,7 +165,7 @@ func (c *Client) GetCertificate(ctx context.Context, certificateName string, opt
170
165
171
166
return GetCertificateResponse {
172
167
CertificateWithPolicy : CertificateWithPolicy {
173
- Properties : propertiesFromGenerated (resp .Attributes , convertGeneratedMap ( resp .Tags ) , resp .ID , resp .X509Thumbprint ),
168
+ Properties : propertiesFromGenerated (resp .Attributes , resp .Tags , resp .ID , resp .X509Thumbprint ),
174
169
CER : resp .Cer ,
175
170
ContentType : resp .ContentType ,
176
171
ID : resp .ID ,
@@ -240,7 +235,7 @@ func deleteCertificateResponseFromGenerated(g generated.KeyVaultClientDeleteCert
240
235
RecoveryID : g .RecoveryID ,
241
236
DeletedOn : g .DeletedDate ,
242
237
ScheduledPurgeDate : g .ScheduledPurgeDate ,
243
- Properties : propertiesFromGenerated (g .Attributes , convertGeneratedMap ( g .Tags ) , g .ID , g .X509Thumbprint ),
238
+ Properties : propertiesFromGenerated (g .Attributes , g .Tags , g .ID , g .X509Thumbprint ),
244
239
CER : g .Cer ,
245
240
ContentType : g .ContentType ,
246
241
ID : g .ID ,
@@ -340,7 +335,7 @@ func (c *Client) GetDeletedCertificate(ctx context.Context, certificateName stri
340
335
RecoveryID : resp .RecoveryID ,
341
336
DeletedOn : resp .DeletedDate ,
342
337
ScheduledPurgeDate : resp .ScheduledPurgeDate ,
343
- Properties : propertiesFromGenerated (resp .Attributes , convertGeneratedMap ( resp .Tags ) , resp .ID , resp .X509Thumbprint ),
338
+ Properties : propertiesFromGenerated (resp .Attributes , resp .Tags , resp .ID , resp .X509Thumbprint ),
344
339
CER : resp .Cer ,
345
340
ContentType : resp .ContentType ,
346
341
ID : resp .ID ,
@@ -392,7 +387,7 @@ type ImportCertificateOptions struct {
392
387
Password * string `json:"pwd,omitempty"`
393
388
394
389
// Application specific metadata in the form of key-value pairs
395
- Tags map [string ]string `json:"tags,omitempty"`
390
+ Tags map [string ]* string `json:"tags,omitempty"`
396
391
}
397
392
398
393
// ImportCertificateResponse contains response fields for Client.ImportCertificate
@@ -407,10 +402,6 @@ func (c *Client) ImportCertificate(ctx context.Context, certificateName string,
407
402
if options == nil {
408
403
options = & ImportCertificateOptions {}
409
404
}
410
- var tags map [string ]* string
411
- if options .Tags != nil {
412
- tags = convertToGeneratedMap (options .Tags )
413
- }
414
405
resp , err := c .genClient .ImportCertificate (
415
406
ctx ,
416
407
c .vaultURL ,
@@ -422,7 +413,7 @@ func (c *Client) ImportCertificate(ctx context.Context, certificateName string,
422
413
},
423
414
CertificatePolicy : options .CertificatePolicy .toGeneratedCertificateCreateParameters (),
424
415
Password : options .Password ,
425
- Tags : tags ,
416
+ Tags : options . Tags ,
426
417
},
427
418
& generated.KeyVaultClientImportCertificateOptions {},
428
419
)
@@ -432,7 +423,7 @@ func (c *Client) ImportCertificate(ctx context.Context, certificateName string,
432
423
433
424
return ImportCertificateResponse {
434
425
CertificateWithPolicy : CertificateWithPolicy {
435
- Properties : propertiesFromGenerated (resp .Attributes , convertGeneratedMap ( resp .Tags ) , resp .ID , resp .X509Thumbprint ),
426
+ Properties : propertiesFromGenerated (resp .Attributes , resp .Tags , resp .ID , resp .X509Thumbprint ),
436
427
CER : resp .Cer ,
437
428
ContentType : resp .ContentType ,
438
429
ID : resp .ID ,
@@ -443,8 +434,8 @@ func (c *Client) ImportCertificate(ctx context.Context, certificateName string,
443
434
}, nil
444
435
}
445
436
446
- // ListCertificatesOptions contains optional parameters for Client.ListCertificates
447
- type ListCertificatesOptions struct {
437
+ // ListPropertiesOfCertificatesOptions contains optional parameters for Client.ListCertificates
438
+ type ListPropertiesOfCertificatesOptions struct {
448
439
// placeholder for future optional parameters.
449
440
}
450
441
@@ -463,7 +454,7 @@ func listCertsPageFromGenerated(i generated.KeyVaultClientGetCertificatesRespons
463
454
464
455
for _ , v := range i .Value {
465
456
vals = append (vals , & CertificateItem {
466
- Properties : propertiesFromGenerated (v .Attributes , convertGeneratedMap ( v .Tags ) , v .ID , v .X509Thumbprint ),
457
+ Properties : propertiesFromGenerated (v .Attributes , v .Tags , v .ID , v .X509Thumbprint ),
467
458
ID : v .ID ,
468
459
})
469
460
}
@@ -478,7 +469,7 @@ func listCertsPageFromGenerated(i generated.KeyVaultClientGetCertificatesRespons
478
469
// public part of a stored certificate. The LIST operation is applicable to all certificate types, however only the
479
470
// base certificate identifier, attributes, and tags are provided in the response. Individual versions of a
480
471
// certificate are not listed in the response. This operation requires the certificates/list permission.
481
- func (c * Client ) NewListPropertiesOfCertificatesPager (options * ListCertificatesOptions ) * runtime.Pager [ListPropertiesOfCertificatesResponse ] {
472
+ func (c * Client ) NewListPropertiesOfCertificatesPager (options * ListPropertiesOfCertificatesOptions ) * runtime.Pager [ListPropertiesOfCertificatesResponse ] {
482
473
pager := c .genClient .NewGetCertificatesPager (c .vaultURL , nil )
483
474
return runtime .NewPager (runtime.PagingHandler [ListPropertiesOfCertificatesResponse ]{
484
475
More : func (page ListPropertiesOfCertificatesResponse ) bool {
@@ -494,8 +485,8 @@ func (c *Client) NewListPropertiesOfCertificatesPager(options *ListCertificatesO
494
485
})
495
486
}
496
487
497
- // ListCertificateVersionsOptions contains optional parameters for Client.ListCertificateVersions
498
- type ListCertificateVersionsOptions struct {
488
+ // ListPropertiesOfCertificateVersionsOptions contains optional parameters for Client.ListCertificateVersions
489
+ type ListPropertiesOfCertificateVersionsOptions struct {
499
490
// placeholder for future optional parameters.
500
491
}
501
492
@@ -513,7 +504,7 @@ func listCertificateVersionsPageFromGenerated(i generated.KeyVaultClientGetCerti
513
504
var vals []* CertificateItem
514
505
for _ , v := range i .Value {
515
506
vals = append (vals , & CertificateItem {
516
- Properties : propertiesFromGenerated (v .Attributes , convertGeneratedMap ( v .Tags ) , v .ID , v .X509Thumbprint ),
507
+ Properties : propertiesFromGenerated (v .Attributes , v .Tags , v .ID , v .X509Thumbprint ),
517
508
ID : v .ID ,
518
509
})
519
510
}
@@ -527,7 +518,7 @@ func listCertificateVersionsPageFromGenerated(i generated.KeyVaultClientGetCerti
527
518
// NewListPropertiesOfCertificateVersionsPager lists all versions of the specified certificate. The full certificate identifer and
528
519
// attributes are provided in the response. No values are returned for the certificates. This operation
529
520
// requires the certificates/list permission.
530
- func (c * Client ) NewListPropertiesOfCertificateVersionsPager (certificateName string , options * ListCertificateVersionsOptions ) * runtime.Pager [ListPropertiesOfCertificateVersionsResponse ] {
521
+ func (c * Client ) NewListPropertiesOfCertificateVersionsPager (certificateName string , options * ListPropertiesOfCertificateVersionsOptions ) * runtime.Pager [ListPropertiesOfCertificateVersionsResponse ] {
531
522
pager := c .genClient .NewGetCertificateVersionsPager (c .vaultURL , certificateName , nil )
532
523
return runtime .NewPager (runtime.PagingHandler [ListPropertiesOfCertificateVersionsResponse ]{
533
524
More : func (page ListPropertiesOfCertificateVersionsResponse ) bool {
@@ -706,8 +697,8 @@ type ListPropertiesOfIssuersOptions struct {
706
697
// placeholder for future optional parameters
707
698
}
708
699
709
- // ListIssuersPropertiesOfIssuersResponse contains response fields for ListPropertiesOfIssuersPager.NextPage
710
- type ListIssuersPropertiesOfIssuersResponse struct {
700
+ // ListPropertiesOfIssuersResponse contains response fields for ListPropertiesOfIssuersPager.NextPage
701
+ type ListPropertiesOfIssuersResponse struct {
711
702
// READ-ONLY; A response message containing a list of certificates in the key vault along with a link to the next page of certificates.
712
703
Issuers []* IssuerItem `json:"value,omitempty" azure:"ro"`
713
704
@@ -716,28 +707,28 @@ type ListIssuersPropertiesOfIssuersResponse struct {
716
707
}
717
708
718
709
// convert internal Response to ListPropertiesOfIssuersPage
719
- func listIssuersPageFromGenerated (i generated.KeyVaultClientGetCertificateIssuersResponse ) ListIssuersPropertiesOfIssuersResponse {
710
+ func listIssuersPageFromGenerated (i generated.KeyVaultClientGetCertificateIssuersResponse ) ListPropertiesOfIssuersResponse {
720
711
var vals []* IssuerItem
721
712
722
713
for _ , v := range i .Value {
723
714
vals = append (vals , certificateIssuerItemFromGenerated (v ))
724
715
}
725
716
726
- return ListIssuersPropertiesOfIssuersResponse {Issuers : vals , NextLink : i .NextLink }
717
+ return ListPropertiesOfIssuersResponse {Issuers : vals , NextLink : i .NextLink }
727
718
}
728
719
729
720
// NewListPropertiesOfIssuersPager returns a pager that can be used to get the set of certificate issuer resources in the specified key vault. This operation
730
721
// requires the certificates/manageissuers/getissuers permission.
731
- func (c * Client ) NewListPropertiesOfIssuersPager (options * ListPropertiesOfIssuersOptions ) * runtime.Pager [ListIssuersPropertiesOfIssuersResponse ] {
722
+ func (c * Client ) NewListPropertiesOfIssuersPager (options * ListPropertiesOfIssuersOptions ) * runtime.Pager [ListPropertiesOfIssuersResponse ] {
732
723
pager := c .genClient .NewGetCertificateIssuersPager (c .vaultURL , nil )
733
- return runtime .NewPager (runtime.PagingHandler [ListIssuersPropertiesOfIssuersResponse ]{
734
- More : func (page ListIssuersPropertiesOfIssuersResponse ) bool {
724
+ return runtime .NewPager (runtime.PagingHandler [ListPropertiesOfIssuersResponse ]{
725
+ More : func (page ListPropertiesOfIssuersResponse ) bool {
735
726
return pager .More ()
736
727
},
737
- Fetcher : func (ctx context.Context , cur * ListIssuersPropertiesOfIssuersResponse ) (ListIssuersPropertiesOfIssuersResponse , error ) {
728
+ Fetcher : func (ctx context.Context , cur * ListPropertiesOfIssuersResponse ) (ListPropertiesOfIssuersResponse , error ) {
738
729
page , err := pager .NextPage (ctx )
739
730
if err != nil {
740
- return ListIssuersPropertiesOfIssuersResponse {}, err
731
+ return ListPropertiesOfIssuersResponse {}, err
741
732
}
742
733
return listIssuersPageFromGenerated (page ), nil
743
734
},
@@ -1056,14 +1047,8 @@ func (c *Client) GetCertificatePolicy(ctx context.Context, certificateName strin
1056
1047
1057
1048
// UpdateCertificatePropertiesOptions contains optional parameters for Client.UpdateCertificateProperties
1058
1049
type UpdateCertificatePropertiesOptions struct {
1059
- // The version of the certificate to update
1060
- Version string
1061
-
1062
- // The attributes of the certificate (optional).
1063
- Properties * Properties `json:"attributes,omitempty"`
1050
+ // placeholder for future optional parameters
1064
1051
1065
- // The management policy for the certificate.
1066
- CertificatePolicy * Policy `json:"policy,omitempty"`
1067
1052
}
1068
1053
1069
1054
func (u * UpdateCertificatePropertiesOptions ) toGenerated () * generated.KeyVaultClientUpdateCertificateOptions {
@@ -1081,18 +1066,18 @@ func (c *Client) UpdateCertificateProperties(ctx context.Context, certificateNam
1081
1066
if options == nil {
1082
1067
options = & UpdateCertificatePropertiesOptions {}
1083
1068
}
1084
- var tags map [ string ] * string
1085
- if properties .Tags != nil {
1086
- tags = convertToGeneratedMap ( properties .Tags )
1069
+ version := ""
1070
+ if properties .Version != nil {
1071
+ version = * properties .Version
1087
1072
}
1088
1073
resp , err := c .genClient .UpdateCertificate (
1089
1074
ctx ,
1090
1075
c .vaultURL ,
1091
1076
certificateName ,
1092
- options . Version ,
1077
+ version ,
1093
1078
generated.CertificateUpdateParameters {
1094
1079
CertificateAttributes : properties .toGenerated (),
1095
- Tags : tags ,
1080
+ Tags : properties . Tags ,
1096
1081
},
1097
1082
options .toGenerated (),
1098
1083
)
@@ -1126,7 +1111,7 @@ func (c *Client) MergeCertificate(ctx context.Context, certificateName string, c
1126
1111
}
1127
1112
var tags map [string ]* string
1128
1113
if options .Properties != nil && options .Properties .Tags != nil {
1129
- tags = convertToGeneratedMap ( options .Properties .Tags )
1114
+ tags = options .Properties .Tags
1130
1115
}
1131
1116
resp , err := c .genClient .MergeCertificate (
1132
1117
ctx , c .vaultURL ,
@@ -1144,7 +1129,7 @@ func (c *Client) MergeCertificate(ctx context.Context, certificateName string, c
1144
1129
1145
1130
return MergeCertificateResponse {
1146
1131
CertificateWithPolicy : CertificateWithPolicy {
1147
- Properties : propertiesFromGenerated (resp .Attributes , convertGeneratedMap ( resp .Tags ) , resp .ID , resp .X509Thumbprint ),
1132
+ Properties : propertiesFromGenerated (resp .Attributes , resp .Tags , resp .ID , resp .X509Thumbprint ),
1148
1133
CER : resp .Cer ,
1149
1134
ContentType : resp .ContentType ,
1150
1135
ID : resp .ID ,
@@ -1185,7 +1170,7 @@ func (c *Client) RestoreCertificateBackup(ctx context.Context, certificateBackup
1185
1170
1186
1171
return RestoreCertificateBackupResponse {
1187
1172
CertificateWithPolicy : CertificateWithPolicy {
1188
- Properties : propertiesFromGenerated (resp .Attributes , convertGeneratedMap ( resp .Tags ) , resp .ID , resp .X509Thumbprint ),
1173
+ Properties : propertiesFromGenerated (resp .Attributes , resp .Tags , resp .ID , resp .X509Thumbprint ),
1189
1174
CER : resp .Cer ,
1190
1175
ContentType : resp .ContentType ,
1191
1176
ID : resp .ID ,
@@ -1255,7 +1240,7 @@ func (c *Client) BeginRecoverDeletedCertificate(ctx context.Context, certificate
1255
1240
// ListDeletedCertificatesResponse contains response field for ListDeletedCertificatesPager.NextPage
1256
1241
type ListDeletedCertificatesResponse struct {
1257
1242
// READ-ONLY; A response message containing a list of deleted certificates in the vault along with a link to the next page of deleted certificates
1258
- Certificates []* DeletedCertificateItem `json:"value,omitempty" azure:"ro"`
1243
+ DeletedCertificates []* DeletedCertificateItem `json:"value,omitempty" azure:"ro"`
1259
1244
1260
1245
// NextLink gives the next page of items to fetch
1261
1246
NextLink * string
@@ -1270,7 +1255,7 @@ func listDeletedCertsPageFromGenerated(g generated.KeyVaultClientGetDeletedCerti
1270
1255
for i , c := range g .Value {
1271
1256
_ , name , _ := shared .ParseID (c .ID )
1272
1257
certs [i ] = & DeletedCertificateItem {
1273
- Properties : propertiesFromGenerated (c .Attributes , convertGeneratedMap ( c .Tags ) , c .ID , c .X509Thumbprint ),
1258
+ Properties : propertiesFromGenerated (c .Attributes , c .Tags , c .ID , c .X509Thumbprint ),
1274
1259
ID : c .ID ,
1275
1260
Name : name ,
1276
1261
RecoveryID : c .RecoveryID ,
@@ -1281,8 +1266,8 @@ func listDeletedCertsPageFromGenerated(g generated.KeyVaultClientGetDeletedCerti
1281
1266
}
1282
1267
1283
1268
return ListDeletedCertificatesResponse {
1284
- Certificates : certs ,
1285
- NextLink : g .NextLink ,
1269
+ DeletedCertificates : certs ,
1270
+ NextLink : g .NextLink ,
1286
1271
}
1287
1272
}
1288
1273
0 commit comments