1package keyvault 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "encoding/json" 22 "github.com/Azure/go-autorest/autorest" 23 "github.com/Azure/go-autorest/autorest/date" 24 "github.com/Azure/go-autorest/autorest/to" 25 "net/http" 26) 27 28// ActionType enumerates the values for action type. 29type ActionType string 30 31const ( 32 // AutoRenew ... 33 AutoRenew ActionType = "AutoRenew" 34 // EmailContacts ... 35 EmailContacts ActionType = "EmailContacts" 36) 37 38// PossibleActionTypeValues returns an array of possible values for the ActionType const type. 39func PossibleActionTypeValues() []ActionType { 40 return []ActionType{AutoRenew, EmailContacts} 41} 42 43// DeletionRecoveryLevel enumerates the values for deletion recovery level. 44type DeletionRecoveryLevel string 45 46const ( 47 // Purgeable ... 48 Purgeable DeletionRecoveryLevel = "Purgeable" 49 // Recoverable ... 50 Recoverable DeletionRecoveryLevel = "Recoverable" 51 // RecoverableProtectedSubscription ... 52 RecoverableProtectedSubscription DeletionRecoveryLevel = "Recoverable+ProtectedSubscription" 53 // RecoverablePurgeable ... 54 RecoverablePurgeable DeletionRecoveryLevel = "Recoverable+Purgeable" 55) 56 57// PossibleDeletionRecoveryLevelValues returns an array of possible values for the DeletionRecoveryLevel const type. 58func PossibleDeletionRecoveryLevelValues() []DeletionRecoveryLevel { 59 return []DeletionRecoveryLevel{Purgeable, Recoverable, RecoverableProtectedSubscription, RecoverablePurgeable} 60} 61 62// JSONWebKeyCurveName enumerates the values for json web key curve name. 63type JSONWebKeyCurveName string 64 65const ( 66 // P256 ... 67 P256 JSONWebKeyCurveName = "P-256" 68 // P384 ... 69 P384 JSONWebKeyCurveName = "P-384" 70 // P521 ... 71 P521 JSONWebKeyCurveName = "P-521" 72 // SECP256K1 ... 73 SECP256K1 JSONWebKeyCurveName = "SECP256K1" 74) 75 76// PossibleJSONWebKeyCurveNameValues returns an array of possible values for the JSONWebKeyCurveName const type. 77func PossibleJSONWebKeyCurveNameValues() []JSONWebKeyCurveName { 78 return []JSONWebKeyCurveName{P256, P384, P521, SECP256K1} 79} 80 81// JSONWebKeyEncryptionAlgorithm enumerates the values for json web key encryption algorithm. 82type JSONWebKeyEncryptionAlgorithm string 83 84const ( 85 // RSA15 ... 86 RSA15 JSONWebKeyEncryptionAlgorithm = "RSA1_5" 87 // RSAOAEP ... 88 RSAOAEP JSONWebKeyEncryptionAlgorithm = "RSA-OAEP" 89 // RSAOAEP256 ... 90 RSAOAEP256 JSONWebKeyEncryptionAlgorithm = "RSA-OAEP-256" 91) 92 93// PossibleJSONWebKeyEncryptionAlgorithmValues returns an array of possible values for the JSONWebKeyEncryptionAlgorithm const type. 94func PossibleJSONWebKeyEncryptionAlgorithmValues() []JSONWebKeyEncryptionAlgorithm { 95 return []JSONWebKeyEncryptionAlgorithm{RSA15, RSAOAEP, RSAOAEP256} 96} 97 98// JSONWebKeyOperation enumerates the values for json web key operation. 99type JSONWebKeyOperation string 100 101const ( 102 // Decrypt ... 103 Decrypt JSONWebKeyOperation = "decrypt" 104 // Encrypt ... 105 Encrypt JSONWebKeyOperation = "encrypt" 106 // Sign ... 107 Sign JSONWebKeyOperation = "sign" 108 // UnwrapKey ... 109 UnwrapKey JSONWebKeyOperation = "unwrapKey" 110 // Verify ... 111 Verify JSONWebKeyOperation = "verify" 112 // WrapKey ... 113 WrapKey JSONWebKeyOperation = "wrapKey" 114) 115 116// PossibleJSONWebKeyOperationValues returns an array of possible values for the JSONWebKeyOperation const type. 117func PossibleJSONWebKeyOperationValues() []JSONWebKeyOperation { 118 return []JSONWebKeyOperation{Decrypt, Encrypt, Sign, UnwrapKey, Verify, WrapKey} 119} 120 121// JSONWebKeySignatureAlgorithm enumerates the values for json web key signature algorithm. 122type JSONWebKeySignatureAlgorithm string 123 124const ( 125 // ECDSA256 ... 126 ECDSA256 JSONWebKeySignatureAlgorithm = "ECDSA256" 127 // ES256 ... 128 ES256 JSONWebKeySignatureAlgorithm = "ES256" 129 // ES384 ... 130 ES384 JSONWebKeySignatureAlgorithm = "ES384" 131 // ES512 ... 132 ES512 JSONWebKeySignatureAlgorithm = "ES512" 133 // PS256 ... 134 PS256 JSONWebKeySignatureAlgorithm = "PS256" 135 // PS384 ... 136 PS384 JSONWebKeySignatureAlgorithm = "PS384" 137 // PS512 ... 138 PS512 JSONWebKeySignatureAlgorithm = "PS512" 139 // RS256 ... 140 RS256 JSONWebKeySignatureAlgorithm = "RS256" 141 // RS384 ... 142 RS384 JSONWebKeySignatureAlgorithm = "RS384" 143 // RS512 ... 144 RS512 JSONWebKeySignatureAlgorithm = "RS512" 145 // RSNULL ... 146 RSNULL JSONWebKeySignatureAlgorithm = "RSNULL" 147) 148 149// PossibleJSONWebKeySignatureAlgorithmValues returns an array of possible values for the JSONWebKeySignatureAlgorithm const type. 150func PossibleJSONWebKeySignatureAlgorithmValues() []JSONWebKeySignatureAlgorithm { 151 return []JSONWebKeySignatureAlgorithm{ECDSA256, ES256, ES384, ES512, PS256, PS384, PS512, RS256, RS384, RS512, RSNULL} 152} 153 154// JSONWebKeyType enumerates the values for json web key type. 155type JSONWebKeyType string 156 157const ( 158 // EC ... 159 EC JSONWebKeyType = "EC" 160 // ECHSM ... 161 ECHSM JSONWebKeyType = "EC-HSM" 162 // Oct ... 163 Oct JSONWebKeyType = "oct" 164 // RSA ... 165 RSA JSONWebKeyType = "RSA" 166 // RSAHSM ... 167 RSAHSM JSONWebKeyType = "RSA-HSM" 168) 169 170// PossibleJSONWebKeyTypeValues returns an array of possible values for the JSONWebKeyType const type. 171func PossibleJSONWebKeyTypeValues() []JSONWebKeyType { 172 return []JSONWebKeyType{EC, ECHSM, Oct, RSA, RSAHSM} 173} 174 175// KeyUsageType enumerates the values for key usage type. 176type KeyUsageType string 177 178const ( 179 // CRLSign ... 180 CRLSign KeyUsageType = "cRLSign" 181 // DataEncipherment ... 182 DataEncipherment KeyUsageType = "dataEncipherment" 183 // DecipherOnly ... 184 DecipherOnly KeyUsageType = "decipherOnly" 185 // DigitalSignature ... 186 DigitalSignature KeyUsageType = "digitalSignature" 187 // EncipherOnly ... 188 EncipherOnly KeyUsageType = "encipherOnly" 189 // KeyAgreement ... 190 KeyAgreement KeyUsageType = "keyAgreement" 191 // KeyCertSign ... 192 KeyCertSign KeyUsageType = "keyCertSign" 193 // KeyEncipherment ... 194 KeyEncipherment KeyUsageType = "keyEncipherment" 195 // NonRepudiation ... 196 NonRepudiation KeyUsageType = "nonRepudiation" 197) 198 199// PossibleKeyUsageTypeValues returns an array of possible values for the KeyUsageType const type. 200func PossibleKeyUsageTypeValues() []KeyUsageType { 201 return []KeyUsageType{CRLSign, DataEncipherment, DecipherOnly, DigitalSignature, EncipherOnly, KeyAgreement, KeyCertSign, KeyEncipherment, NonRepudiation} 202} 203 204// SasTokenType enumerates the values for sas token type. 205type SasTokenType string 206 207const ( 208 // Account ... 209 Account SasTokenType = "account" 210 // Service ... 211 Service SasTokenType = "service" 212) 213 214// PossibleSasTokenTypeValues returns an array of possible values for the SasTokenType const type. 215func PossibleSasTokenTypeValues() []SasTokenType { 216 return []SasTokenType{Account, Service} 217} 218 219// Action the action that will be executed. 220type Action struct { 221 // ActionType - The type of the action. Possible values include: 'EmailContacts', 'AutoRenew' 222 ActionType ActionType `json:"action_type,omitempty"` 223} 224 225// AdministratorDetails details of the organization administrator of the certificate issuer. 226type AdministratorDetails struct { 227 // FirstName - First name. 228 FirstName *string `json:"first_name,omitempty"` 229 // LastName - Last name. 230 LastName *string `json:"last_name,omitempty"` 231 // EmailAddress - Email addresss. 232 EmailAddress *string `json:"email,omitempty"` 233 // Phone - Phone number. 234 Phone *string `json:"phone,omitempty"` 235} 236 237// Attributes the object attributes managed by the KeyVault service. 238type Attributes struct { 239 // Enabled - Determines whether the object is enabled. 240 Enabled *bool `json:"enabled,omitempty"` 241 // NotBefore - Not before date in UTC. 242 NotBefore *date.UnixTime `json:"nbf,omitempty"` 243 // Expires - Expiry date in UTC. 244 Expires *date.UnixTime `json:"exp,omitempty"` 245 // Created - Creation time in UTC. 246 Created *date.UnixTime `json:"created,omitempty"` 247 // Updated - Last updated time in UTC. 248 Updated *date.UnixTime `json:"updated,omitempty"` 249} 250 251// BackupKeyResult the backup key result, containing the backup blob. 252type BackupKeyResult struct { 253 autorest.Response `json:"-"` 254 // Value - The backup blob containing the backed up key. 255 Value *string `json:"value,omitempty"` 256} 257 258// BackupSecretResult the backup secret result, containing the backup blob. 259type BackupSecretResult struct { 260 autorest.Response `json:"-"` 261 // Value - The backup blob containing the backed up secret. 262 Value *string `json:"value,omitempty"` 263} 264 265// BackupStorageResult the backup storage result, containing the backup blob. 266type BackupStorageResult struct { 267 autorest.Response `json:"-"` 268 // Value - The backup blob containing the backed up storage account. 269 Value *string `json:"value,omitempty"` 270} 271 272// CertificateAttributes the certificate management attributes. 273type CertificateAttributes struct { 274 // RecoveryLevel - Reflects the deletion recovery level currently in effect for certificates in the current vault. If it contains 'Purgeable', the certificate can be permanently deleted by a privileged user; otherwise, only the system can purge the certificate, at the end of the retention interval. Possible values include: 'Purgeable', 'RecoverablePurgeable', 'Recoverable', 'RecoverableProtectedSubscription' 275 RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` 276 // Enabled - Determines whether the object is enabled. 277 Enabled *bool `json:"enabled,omitempty"` 278 // NotBefore - Not before date in UTC. 279 NotBefore *date.UnixTime `json:"nbf,omitempty"` 280 // Expires - Expiry date in UTC. 281 Expires *date.UnixTime `json:"exp,omitempty"` 282 // Created - Creation time in UTC. 283 Created *date.UnixTime `json:"created,omitempty"` 284 // Updated - Last updated time in UTC. 285 Updated *date.UnixTime `json:"updated,omitempty"` 286} 287 288// CertificateBundle a certificate bundle consists of a certificate (X509) plus its attributes. 289type CertificateBundle struct { 290 autorest.Response `json:"-"` 291 // ID - The certificate id. 292 ID *string `json:"id,omitempty"` 293 // Kid - The key id. 294 Kid *string `json:"kid,omitempty"` 295 // Sid - The secret id. 296 Sid *string `json:"sid,omitempty"` 297 // X509Thumbprint - Thumbprint of the certificate. 298 X509Thumbprint *string `json:"x5t,omitempty"` 299 // Policy - The management policy. 300 Policy *CertificatePolicy `json:"policy,omitempty"` 301 // Cer - CER contents of x509 certificate. 302 Cer *[]byte `json:"cer,omitempty"` 303 // ContentType - The content type of the secret. 304 ContentType *string `json:"contentType,omitempty"` 305 // Attributes - The certificate attributes. 306 Attributes *CertificateAttributes `json:"attributes,omitempty"` 307 // Tags - Application specific metadata in the form of key-value pairs 308 Tags map[string]*string `json:"tags"` 309} 310 311// MarshalJSON is the custom marshaler for CertificateBundle. 312func (cb CertificateBundle) MarshalJSON() ([]byte, error) { 313 objectMap := make(map[string]interface{}) 314 if cb.ID != nil { 315 objectMap["id"] = cb.ID 316 } 317 if cb.Kid != nil { 318 objectMap["kid"] = cb.Kid 319 } 320 if cb.Sid != nil { 321 objectMap["sid"] = cb.Sid 322 } 323 if cb.X509Thumbprint != nil { 324 objectMap["x5t"] = cb.X509Thumbprint 325 } 326 if cb.Policy != nil { 327 objectMap["policy"] = cb.Policy 328 } 329 if cb.Cer != nil { 330 objectMap["cer"] = cb.Cer 331 } 332 if cb.ContentType != nil { 333 objectMap["contentType"] = cb.ContentType 334 } 335 if cb.Attributes != nil { 336 objectMap["attributes"] = cb.Attributes 337 } 338 if cb.Tags != nil { 339 objectMap["tags"] = cb.Tags 340 } 341 return json.Marshal(objectMap) 342} 343 344// CertificateCreateParameters the certificate create parameters. 345type CertificateCreateParameters struct { 346 // CertificatePolicy - The management policy for the certificate. 347 CertificatePolicy *CertificatePolicy `json:"policy,omitempty"` 348 // CertificateAttributes - The attributes of the certificate (optional). 349 CertificateAttributes *CertificateAttributes `json:"attributes,omitempty"` 350 // Tags - Application specific metadata in the form of key-value pairs. 351 Tags map[string]*string `json:"tags"` 352} 353 354// MarshalJSON is the custom marshaler for CertificateCreateParameters. 355func (ccp CertificateCreateParameters) MarshalJSON() ([]byte, error) { 356 objectMap := make(map[string]interface{}) 357 if ccp.CertificatePolicy != nil { 358 objectMap["policy"] = ccp.CertificatePolicy 359 } 360 if ccp.CertificateAttributes != nil { 361 objectMap["attributes"] = ccp.CertificateAttributes 362 } 363 if ccp.Tags != nil { 364 objectMap["tags"] = ccp.Tags 365 } 366 return json.Marshal(objectMap) 367} 368 369// CertificateImportParameters the certificate import parameters. 370type CertificateImportParameters struct { 371 // Base64EncodedCertificate - Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. 372 Base64EncodedCertificate *string `json:"value,omitempty"` 373 // Password - If the private key in base64EncodedCertificate is encrypted, the password used for encryption. 374 Password *string `json:"pwd,omitempty"` 375 // CertificatePolicy - The management policy for the certificate. 376 CertificatePolicy *CertificatePolicy `json:"policy,omitempty"` 377 // CertificateAttributes - The attributes of the certificate (optional). 378 CertificateAttributes *CertificateAttributes `json:"attributes,omitempty"` 379 // Tags - Application specific metadata in the form of key-value pairs. 380 Tags map[string]*string `json:"tags"` 381} 382 383// MarshalJSON is the custom marshaler for CertificateImportParameters. 384func (cip CertificateImportParameters) MarshalJSON() ([]byte, error) { 385 objectMap := make(map[string]interface{}) 386 if cip.Base64EncodedCertificate != nil { 387 objectMap["value"] = cip.Base64EncodedCertificate 388 } 389 if cip.Password != nil { 390 objectMap["pwd"] = cip.Password 391 } 392 if cip.CertificatePolicy != nil { 393 objectMap["policy"] = cip.CertificatePolicy 394 } 395 if cip.CertificateAttributes != nil { 396 objectMap["attributes"] = cip.CertificateAttributes 397 } 398 if cip.Tags != nil { 399 objectMap["tags"] = cip.Tags 400 } 401 return json.Marshal(objectMap) 402} 403 404// CertificateIssuerItem the certificate issuer item containing certificate issuer metadata. 405type CertificateIssuerItem struct { 406 // ID - Certificate Identifier. 407 ID *string `json:"id,omitempty"` 408 // Provider - The issuer provider. 409 Provider *string `json:"provider,omitempty"` 410} 411 412// CertificateIssuerListResult the certificate issuer list result. 413type CertificateIssuerListResult struct { 414 autorest.Response `json:"-"` 415 // Value - A response message containing a list of certificate issuers in the key vault along with a link to the next page of certificate issuers. 416 Value *[]CertificateIssuerItem `json:"value,omitempty"` 417 // NextLink - The URL to get the next set of certificate issuers. 418 NextLink *string `json:"nextLink,omitempty"` 419} 420 421// CertificateIssuerListResultIterator provides access to a complete listing of CertificateIssuerItem values. 422type CertificateIssuerListResultIterator struct { 423 i int 424 page CertificateIssuerListResultPage 425} 426 427// Next advances to the next value. If there was an error making 428// the request the iterator does not advance and the error is returned. 429func (iter *CertificateIssuerListResultIterator) Next() error { 430 iter.i++ 431 if iter.i < len(iter.page.Values()) { 432 return nil 433 } 434 err := iter.page.Next() 435 if err != nil { 436 iter.i-- 437 return err 438 } 439 iter.i = 0 440 return nil 441} 442 443// NotDone returns true if the enumeration should be started or is not yet complete. 444func (iter CertificateIssuerListResultIterator) NotDone() bool { 445 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 446} 447 448// Response returns the raw server response from the last page request. 449func (iter CertificateIssuerListResultIterator) Response() CertificateIssuerListResult { 450 return iter.page.Response() 451} 452 453// Value returns the current value or a zero-initialized value if the 454// iterator has advanced beyond the end of the collection. 455func (iter CertificateIssuerListResultIterator) Value() CertificateIssuerItem { 456 if !iter.page.NotDone() { 457 return CertificateIssuerItem{} 458 } 459 return iter.page.Values()[iter.i] 460} 461 462// IsEmpty returns true if the ListResult contains no values. 463func (cilr CertificateIssuerListResult) IsEmpty() bool { 464 return cilr.Value == nil || len(*cilr.Value) == 0 465} 466 467// certificateIssuerListResultPreparer prepares a request to retrieve the next set of results. 468// It returns nil if no more results exist. 469func (cilr CertificateIssuerListResult) certificateIssuerListResultPreparer() (*http.Request, error) { 470 if cilr.NextLink == nil || len(to.String(cilr.NextLink)) < 1 { 471 return nil, nil 472 } 473 return autorest.Prepare(&http.Request{}, 474 autorest.AsJSON(), 475 autorest.AsGet(), 476 autorest.WithBaseURL(to.String(cilr.NextLink))) 477} 478 479// CertificateIssuerListResultPage contains a page of CertificateIssuerItem values. 480type CertificateIssuerListResultPage struct { 481 fn func(CertificateIssuerListResult) (CertificateIssuerListResult, error) 482 cilr CertificateIssuerListResult 483} 484 485// Next advances to the next page of values. If there was an error making 486// the request the page does not advance and the error is returned. 487func (page *CertificateIssuerListResultPage) Next() error { 488 next, err := page.fn(page.cilr) 489 if err != nil { 490 return err 491 } 492 page.cilr = next 493 return nil 494} 495 496// NotDone returns true if the page enumeration should be started or is not yet complete. 497func (page CertificateIssuerListResultPage) NotDone() bool { 498 return !page.cilr.IsEmpty() 499} 500 501// Response returns the raw server response from the last page request. 502func (page CertificateIssuerListResultPage) Response() CertificateIssuerListResult { 503 return page.cilr 504} 505 506// Values returns the slice of values for the current page or nil if there are no values. 507func (page CertificateIssuerListResultPage) Values() []CertificateIssuerItem { 508 if page.cilr.IsEmpty() { 509 return nil 510 } 511 return *page.cilr.Value 512} 513 514// CertificateIssuerSetParameters the certificate issuer set parameters. 515type CertificateIssuerSetParameters struct { 516 // Provider - The issuer provider. 517 Provider *string `json:"provider,omitempty"` 518 // Credentials - The credentials to be used for the issuer. 519 Credentials *IssuerCredentials `json:"credentials,omitempty"` 520 // OrganizationDetails - Details of the organization as provided to the issuer. 521 OrganizationDetails *OrganizationDetails `json:"org_details,omitempty"` 522 // Attributes - Attributes of the issuer object. 523 Attributes *IssuerAttributes `json:"attributes,omitempty"` 524} 525 526// CertificateIssuerUpdateParameters the certificate issuer update parameters. 527type CertificateIssuerUpdateParameters struct { 528 // Provider - The issuer provider. 529 Provider *string `json:"provider,omitempty"` 530 // Credentials - The credentials to be used for the issuer. 531 Credentials *IssuerCredentials `json:"credentials,omitempty"` 532 // OrganizationDetails - Details of the organization as provided to the issuer. 533 OrganizationDetails *OrganizationDetails `json:"org_details,omitempty"` 534 // Attributes - Attributes of the issuer object. 535 Attributes *IssuerAttributes `json:"attributes,omitempty"` 536} 537 538// CertificateItem the certificate item containing certificate metadata. 539type CertificateItem struct { 540 // ID - Certificate identifier. 541 ID *string `json:"id,omitempty"` 542 // Attributes - The certificate management attributes. 543 Attributes *CertificateAttributes `json:"attributes,omitempty"` 544 // Tags - Application specific metadata in the form of key-value pairs. 545 Tags map[string]*string `json:"tags"` 546 // X509Thumbprint - Thumbprint of the certificate. 547 X509Thumbprint *string `json:"x5t,omitempty"` 548} 549 550// MarshalJSON is the custom marshaler for CertificateItem. 551func (ci CertificateItem) MarshalJSON() ([]byte, error) { 552 objectMap := make(map[string]interface{}) 553 if ci.ID != nil { 554 objectMap["id"] = ci.ID 555 } 556 if ci.Attributes != nil { 557 objectMap["attributes"] = ci.Attributes 558 } 559 if ci.Tags != nil { 560 objectMap["tags"] = ci.Tags 561 } 562 if ci.X509Thumbprint != nil { 563 objectMap["x5t"] = ci.X509Thumbprint 564 } 565 return json.Marshal(objectMap) 566} 567 568// CertificateListResult the certificate list result. 569type CertificateListResult struct { 570 autorest.Response `json:"-"` 571 // Value - A response message containing a list of certificates in the key vault along with a link to the next page of certificates. 572 Value *[]CertificateItem `json:"value,omitempty"` 573 // NextLink - The URL to get the next set of certificates. 574 NextLink *string `json:"nextLink,omitempty"` 575} 576 577// CertificateListResultIterator provides access to a complete listing of CertificateItem values. 578type CertificateListResultIterator struct { 579 i int 580 page CertificateListResultPage 581} 582 583// Next advances to the next value. If there was an error making 584// the request the iterator does not advance and the error is returned. 585func (iter *CertificateListResultIterator) Next() error { 586 iter.i++ 587 if iter.i < len(iter.page.Values()) { 588 return nil 589 } 590 err := iter.page.Next() 591 if err != nil { 592 iter.i-- 593 return err 594 } 595 iter.i = 0 596 return nil 597} 598 599// NotDone returns true if the enumeration should be started or is not yet complete. 600func (iter CertificateListResultIterator) NotDone() bool { 601 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 602} 603 604// Response returns the raw server response from the last page request. 605func (iter CertificateListResultIterator) Response() CertificateListResult { 606 return iter.page.Response() 607} 608 609// Value returns the current value or a zero-initialized value if the 610// iterator has advanced beyond the end of the collection. 611func (iter CertificateListResultIterator) Value() CertificateItem { 612 if !iter.page.NotDone() { 613 return CertificateItem{} 614 } 615 return iter.page.Values()[iter.i] 616} 617 618// IsEmpty returns true if the ListResult contains no values. 619func (clr CertificateListResult) IsEmpty() bool { 620 return clr.Value == nil || len(*clr.Value) == 0 621} 622 623// certificateListResultPreparer prepares a request to retrieve the next set of results. 624// It returns nil if no more results exist. 625func (clr CertificateListResult) certificateListResultPreparer() (*http.Request, error) { 626 if clr.NextLink == nil || len(to.String(clr.NextLink)) < 1 { 627 return nil, nil 628 } 629 return autorest.Prepare(&http.Request{}, 630 autorest.AsJSON(), 631 autorest.AsGet(), 632 autorest.WithBaseURL(to.String(clr.NextLink))) 633} 634 635// CertificateListResultPage contains a page of CertificateItem values. 636type CertificateListResultPage struct { 637 fn func(CertificateListResult) (CertificateListResult, error) 638 clr CertificateListResult 639} 640 641// Next advances to the next page of values. If there was an error making 642// the request the page does not advance and the error is returned. 643func (page *CertificateListResultPage) Next() error { 644 next, err := page.fn(page.clr) 645 if err != nil { 646 return err 647 } 648 page.clr = next 649 return nil 650} 651 652// NotDone returns true if the page enumeration should be started or is not yet complete. 653func (page CertificateListResultPage) NotDone() bool { 654 return !page.clr.IsEmpty() 655} 656 657// Response returns the raw server response from the last page request. 658func (page CertificateListResultPage) Response() CertificateListResult { 659 return page.clr 660} 661 662// Values returns the slice of values for the current page or nil if there are no values. 663func (page CertificateListResultPage) Values() []CertificateItem { 664 if page.clr.IsEmpty() { 665 return nil 666 } 667 return *page.clr.Value 668} 669 670// CertificateMergeParameters the certificate merge parameters 671type CertificateMergeParameters struct { 672 // X509Certificates - The certificate or the certificate chain to merge. 673 X509Certificates *[][]byte `json:"x5c,omitempty"` 674 // CertificateAttributes - The attributes of the certificate (optional). 675 CertificateAttributes *CertificateAttributes `json:"attributes,omitempty"` 676 // Tags - Application specific metadata in the form of key-value pairs. 677 Tags map[string]*string `json:"tags"` 678} 679 680// MarshalJSON is the custom marshaler for CertificateMergeParameters. 681func (cmp CertificateMergeParameters) MarshalJSON() ([]byte, error) { 682 objectMap := make(map[string]interface{}) 683 if cmp.X509Certificates != nil { 684 objectMap["x5c"] = cmp.X509Certificates 685 } 686 if cmp.CertificateAttributes != nil { 687 objectMap["attributes"] = cmp.CertificateAttributes 688 } 689 if cmp.Tags != nil { 690 objectMap["tags"] = cmp.Tags 691 } 692 return json.Marshal(objectMap) 693} 694 695// CertificateOperation a certificate operation is returned in case of asynchronous requests. 696type CertificateOperation struct { 697 autorest.Response `json:"-"` 698 // ID - The certificate id. 699 ID *string `json:"id,omitempty"` 700 // IssuerParameters - Parameters for the issuer of the X509 component of a certificate. 701 IssuerParameters *IssuerParameters `json:"issuer,omitempty"` 702 // Csr - The certificate signing request (CSR) that is being used in the certificate operation. 703 Csr *[]byte `json:"csr,omitempty"` 704 // CancellationRequested - Indicates if cancellation was requested on the certificate operation. 705 CancellationRequested *bool `json:"cancellation_requested,omitempty"` 706 // Status - Status of the certificate operation. 707 Status *string `json:"status,omitempty"` 708 // StatusDetails - The status details of the certificate operation. 709 StatusDetails *string `json:"status_details,omitempty"` 710 // Error - Error encountered, if any, during the certificate operation. 711 Error *Error `json:"error,omitempty"` 712 // Target - Location which contains the result of the certificate operation. 713 Target *string `json:"target,omitempty"` 714 // RequestID - Identifier for the certificate operation. 715 RequestID *string `json:"request_id,omitempty"` 716} 717 718// CertificateOperationUpdateParameter the certificate operation update parameters. 719type CertificateOperationUpdateParameter struct { 720 // CancellationRequested - Indicates if cancellation was requested on the certificate operation. 721 CancellationRequested *bool `json:"cancellation_requested,omitempty"` 722} 723 724// CertificatePolicy management policy for a certificate. 725type CertificatePolicy struct { 726 autorest.Response `json:"-"` 727 // ID - The certificate id. 728 ID *string `json:"id,omitempty"` 729 // KeyProperties - Properties of the key backing a certificate. 730 KeyProperties *KeyProperties `json:"key_props,omitempty"` 731 // SecretProperties - Properties of the secret backing a certificate. 732 SecretProperties *SecretProperties `json:"secret_props,omitempty"` 733 // X509CertificateProperties - Properties of the X509 component of a certificate. 734 X509CertificateProperties *X509CertificateProperties `json:"x509_props,omitempty"` 735 // LifetimeActions - Actions that will be performed by Key Vault over the lifetime of a certificate. 736 LifetimeActions *[]LifetimeAction `json:"lifetime_actions,omitempty"` 737 // IssuerParameters - Parameters for the issuer of the X509 component of a certificate. 738 IssuerParameters *IssuerParameters `json:"issuer,omitempty"` 739 // Attributes - The certificate attributes. 740 Attributes *CertificateAttributes `json:"attributes,omitempty"` 741} 742 743// CertificateUpdateParameters the certificate update parameters. 744type CertificateUpdateParameters struct { 745 // CertificatePolicy - The management policy for the certificate. 746 CertificatePolicy *CertificatePolicy `json:"policy,omitempty"` 747 // CertificateAttributes - The attributes of the certificate (optional). 748 CertificateAttributes *CertificateAttributes `json:"attributes,omitempty"` 749 // Tags - Application specific metadata in the form of key-value pairs. 750 Tags map[string]*string `json:"tags"` 751} 752 753// MarshalJSON is the custom marshaler for CertificateUpdateParameters. 754func (cup CertificateUpdateParameters) MarshalJSON() ([]byte, error) { 755 objectMap := make(map[string]interface{}) 756 if cup.CertificatePolicy != nil { 757 objectMap["policy"] = cup.CertificatePolicy 758 } 759 if cup.CertificateAttributes != nil { 760 objectMap["attributes"] = cup.CertificateAttributes 761 } 762 if cup.Tags != nil { 763 objectMap["tags"] = cup.Tags 764 } 765 return json.Marshal(objectMap) 766} 767 768// Contact the contact information for the vault certificates. 769type Contact struct { 770 // EmailAddress - Email addresss. 771 EmailAddress *string `json:"email,omitempty"` 772 // Name - Name. 773 Name *string `json:"name,omitempty"` 774 // Phone - Phone number. 775 Phone *string `json:"phone,omitempty"` 776} 777 778// Contacts the contacts for the vault certificates. 779type Contacts struct { 780 autorest.Response `json:"-"` 781 // ID - Identifier for the contacts collection. 782 ID *string `json:"id,omitempty"` 783 // ContactList - The contact list for the vault certificates. 784 ContactList *[]Contact `json:"contacts,omitempty"` 785} 786 787// DeletedCertificateBundle a Deleted Certificate consisting of its previous id, attributes and its tags, as well 788// as information on when it will be purged. 789type DeletedCertificateBundle struct { 790 autorest.Response `json:"-"` 791 // RecoveryID - The url of the recovery object, used to identify and recover the deleted certificate. 792 RecoveryID *string `json:"recoveryId,omitempty"` 793 // ScheduledPurgeDate - The time when the certificate is scheduled to be purged, in UTC 794 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 795 // DeletedDate - The time when the certificate was deleted, in UTC 796 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 797 // ID - The certificate id. 798 ID *string `json:"id,omitempty"` 799 // Kid - The key id. 800 Kid *string `json:"kid,omitempty"` 801 // Sid - The secret id. 802 Sid *string `json:"sid,omitempty"` 803 // X509Thumbprint - Thumbprint of the certificate. 804 X509Thumbprint *string `json:"x5t,omitempty"` 805 // Policy - The management policy. 806 Policy *CertificatePolicy `json:"policy,omitempty"` 807 // Cer - CER contents of x509 certificate. 808 Cer *[]byte `json:"cer,omitempty"` 809 // ContentType - The content type of the secret. 810 ContentType *string `json:"contentType,omitempty"` 811 // Attributes - The certificate attributes. 812 Attributes *CertificateAttributes `json:"attributes,omitempty"` 813 // Tags - Application specific metadata in the form of key-value pairs 814 Tags map[string]*string `json:"tags"` 815} 816 817// MarshalJSON is the custom marshaler for DeletedCertificateBundle. 818func (dcb DeletedCertificateBundle) MarshalJSON() ([]byte, error) { 819 objectMap := make(map[string]interface{}) 820 if dcb.RecoveryID != nil { 821 objectMap["recoveryId"] = dcb.RecoveryID 822 } 823 if dcb.ScheduledPurgeDate != nil { 824 objectMap["scheduledPurgeDate"] = dcb.ScheduledPurgeDate 825 } 826 if dcb.DeletedDate != nil { 827 objectMap["deletedDate"] = dcb.DeletedDate 828 } 829 if dcb.ID != nil { 830 objectMap["id"] = dcb.ID 831 } 832 if dcb.Kid != nil { 833 objectMap["kid"] = dcb.Kid 834 } 835 if dcb.Sid != nil { 836 objectMap["sid"] = dcb.Sid 837 } 838 if dcb.X509Thumbprint != nil { 839 objectMap["x5t"] = dcb.X509Thumbprint 840 } 841 if dcb.Policy != nil { 842 objectMap["policy"] = dcb.Policy 843 } 844 if dcb.Cer != nil { 845 objectMap["cer"] = dcb.Cer 846 } 847 if dcb.ContentType != nil { 848 objectMap["contentType"] = dcb.ContentType 849 } 850 if dcb.Attributes != nil { 851 objectMap["attributes"] = dcb.Attributes 852 } 853 if dcb.Tags != nil { 854 objectMap["tags"] = dcb.Tags 855 } 856 return json.Marshal(objectMap) 857} 858 859// DeletedCertificateItem the deleted certificate item containing metadata about the deleted certificate. 860type DeletedCertificateItem struct { 861 // RecoveryID - The url of the recovery object, used to identify and recover the deleted certificate. 862 RecoveryID *string `json:"recoveryId,omitempty"` 863 // ScheduledPurgeDate - The time when the certificate is scheduled to be purged, in UTC 864 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 865 // DeletedDate - The time when the certificate was deleted, in UTC 866 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 867 // ID - Certificate identifier. 868 ID *string `json:"id,omitempty"` 869 // Attributes - The certificate management attributes. 870 Attributes *CertificateAttributes `json:"attributes,omitempty"` 871 // Tags - Application specific metadata in the form of key-value pairs. 872 Tags map[string]*string `json:"tags"` 873 // X509Thumbprint - Thumbprint of the certificate. 874 X509Thumbprint *string `json:"x5t,omitempty"` 875} 876 877// MarshalJSON is the custom marshaler for DeletedCertificateItem. 878func (dci DeletedCertificateItem) MarshalJSON() ([]byte, error) { 879 objectMap := make(map[string]interface{}) 880 if dci.RecoveryID != nil { 881 objectMap["recoveryId"] = dci.RecoveryID 882 } 883 if dci.ScheduledPurgeDate != nil { 884 objectMap["scheduledPurgeDate"] = dci.ScheduledPurgeDate 885 } 886 if dci.DeletedDate != nil { 887 objectMap["deletedDate"] = dci.DeletedDate 888 } 889 if dci.ID != nil { 890 objectMap["id"] = dci.ID 891 } 892 if dci.Attributes != nil { 893 objectMap["attributes"] = dci.Attributes 894 } 895 if dci.Tags != nil { 896 objectMap["tags"] = dci.Tags 897 } 898 if dci.X509Thumbprint != nil { 899 objectMap["x5t"] = dci.X509Thumbprint 900 } 901 return json.Marshal(objectMap) 902} 903 904// DeletedCertificateListResult a list of certificates that have been deleted in this vault. 905type DeletedCertificateListResult struct { 906 autorest.Response `json:"-"` 907 // Value - A response message containing a list of deleted certificates in the vault along with a link to the next page of deleted certificates 908 Value *[]DeletedCertificateItem `json:"value,omitempty"` 909 // NextLink - The URL to get the next set of deleted certificates. 910 NextLink *string `json:"nextLink,omitempty"` 911} 912 913// DeletedCertificateListResultIterator provides access to a complete listing of DeletedCertificateItem values. 914type DeletedCertificateListResultIterator struct { 915 i int 916 page DeletedCertificateListResultPage 917} 918 919// Next advances to the next value. If there was an error making 920// the request the iterator does not advance and the error is returned. 921func (iter *DeletedCertificateListResultIterator) Next() error { 922 iter.i++ 923 if iter.i < len(iter.page.Values()) { 924 return nil 925 } 926 err := iter.page.Next() 927 if err != nil { 928 iter.i-- 929 return err 930 } 931 iter.i = 0 932 return nil 933} 934 935// NotDone returns true if the enumeration should be started or is not yet complete. 936func (iter DeletedCertificateListResultIterator) NotDone() bool { 937 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 938} 939 940// Response returns the raw server response from the last page request. 941func (iter DeletedCertificateListResultIterator) Response() DeletedCertificateListResult { 942 return iter.page.Response() 943} 944 945// Value returns the current value or a zero-initialized value if the 946// iterator has advanced beyond the end of the collection. 947func (iter DeletedCertificateListResultIterator) Value() DeletedCertificateItem { 948 if !iter.page.NotDone() { 949 return DeletedCertificateItem{} 950 } 951 return iter.page.Values()[iter.i] 952} 953 954// IsEmpty returns true if the ListResult contains no values. 955func (dclr DeletedCertificateListResult) IsEmpty() bool { 956 return dclr.Value == nil || len(*dclr.Value) == 0 957} 958 959// deletedCertificateListResultPreparer prepares a request to retrieve the next set of results. 960// It returns nil if no more results exist. 961func (dclr DeletedCertificateListResult) deletedCertificateListResultPreparer() (*http.Request, error) { 962 if dclr.NextLink == nil || len(to.String(dclr.NextLink)) < 1 { 963 return nil, nil 964 } 965 return autorest.Prepare(&http.Request{}, 966 autorest.AsJSON(), 967 autorest.AsGet(), 968 autorest.WithBaseURL(to.String(dclr.NextLink))) 969} 970 971// DeletedCertificateListResultPage contains a page of DeletedCertificateItem values. 972type DeletedCertificateListResultPage struct { 973 fn func(DeletedCertificateListResult) (DeletedCertificateListResult, error) 974 dclr DeletedCertificateListResult 975} 976 977// Next advances to the next page of values. If there was an error making 978// the request the page does not advance and the error is returned. 979func (page *DeletedCertificateListResultPage) Next() error { 980 next, err := page.fn(page.dclr) 981 if err != nil { 982 return err 983 } 984 page.dclr = next 985 return nil 986} 987 988// NotDone returns true if the page enumeration should be started or is not yet complete. 989func (page DeletedCertificateListResultPage) NotDone() bool { 990 return !page.dclr.IsEmpty() 991} 992 993// Response returns the raw server response from the last page request. 994func (page DeletedCertificateListResultPage) Response() DeletedCertificateListResult { 995 return page.dclr 996} 997 998// Values returns the slice of values for the current page or nil if there are no values. 999func (page DeletedCertificateListResultPage) Values() []DeletedCertificateItem { 1000 if page.dclr.IsEmpty() { 1001 return nil 1002 } 1003 return *page.dclr.Value 1004} 1005 1006// DeletedKeyBundle a DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info 1007type DeletedKeyBundle struct { 1008 autorest.Response `json:"-"` 1009 // RecoveryID - The url of the recovery object, used to identify and recover the deleted key. 1010 RecoveryID *string `json:"recoveryId,omitempty"` 1011 // ScheduledPurgeDate - The time when the key is scheduled to be purged, in UTC 1012 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 1013 // DeletedDate - The time when the key was deleted, in UTC 1014 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 1015 // Key - The Json web key. 1016 Key *JSONWebKey `json:"key,omitempty"` 1017 // Attributes - The key management attributes. 1018 Attributes *KeyAttributes `json:"attributes,omitempty"` 1019 // Tags - Application specific metadata in the form of key-value pairs. 1020 Tags map[string]*string `json:"tags"` 1021 // Managed - True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. 1022 Managed *bool `json:"managed,omitempty"` 1023} 1024 1025// MarshalJSON is the custom marshaler for DeletedKeyBundle. 1026func (dkb DeletedKeyBundle) MarshalJSON() ([]byte, error) { 1027 objectMap := make(map[string]interface{}) 1028 if dkb.RecoveryID != nil { 1029 objectMap["recoveryId"] = dkb.RecoveryID 1030 } 1031 if dkb.ScheduledPurgeDate != nil { 1032 objectMap["scheduledPurgeDate"] = dkb.ScheduledPurgeDate 1033 } 1034 if dkb.DeletedDate != nil { 1035 objectMap["deletedDate"] = dkb.DeletedDate 1036 } 1037 if dkb.Key != nil { 1038 objectMap["key"] = dkb.Key 1039 } 1040 if dkb.Attributes != nil { 1041 objectMap["attributes"] = dkb.Attributes 1042 } 1043 if dkb.Tags != nil { 1044 objectMap["tags"] = dkb.Tags 1045 } 1046 if dkb.Managed != nil { 1047 objectMap["managed"] = dkb.Managed 1048 } 1049 return json.Marshal(objectMap) 1050} 1051 1052// DeletedKeyItem the deleted key item containing the deleted key metadata and information about deletion. 1053type DeletedKeyItem struct { 1054 // RecoveryID - The url of the recovery object, used to identify and recover the deleted key. 1055 RecoveryID *string `json:"recoveryId,omitempty"` 1056 // ScheduledPurgeDate - The time when the key is scheduled to be purged, in UTC 1057 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 1058 // DeletedDate - The time when the key was deleted, in UTC 1059 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 1060 // Kid - Key identifier. 1061 Kid *string `json:"kid,omitempty"` 1062 // Attributes - The key management attributes. 1063 Attributes *KeyAttributes `json:"attributes,omitempty"` 1064 // Tags - Application specific metadata in the form of key-value pairs. 1065 Tags map[string]*string `json:"tags"` 1066 // Managed - True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. 1067 Managed *bool `json:"managed,omitempty"` 1068} 1069 1070// MarshalJSON is the custom marshaler for DeletedKeyItem. 1071func (dki DeletedKeyItem) MarshalJSON() ([]byte, error) { 1072 objectMap := make(map[string]interface{}) 1073 if dki.RecoveryID != nil { 1074 objectMap["recoveryId"] = dki.RecoveryID 1075 } 1076 if dki.ScheduledPurgeDate != nil { 1077 objectMap["scheduledPurgeDate"] = dki.ScheduledPurgeDate 1078 } 1079 if dki.DeletedDate != nil { 1080 objectMap["deletedDate"] = dki.DeletedDate 1081 } 1082 if dki.Kid != nil { 1083 objectMap["kid"] = dki.Kid 1084 } 1085 if dki.Attributes != nil { 1086 objectMap["attributes"] = dki.Attributes 1087 } 1088 if dki.Tags != nil { 1089 objectMap["tags"] = dki.Tags 1090 } 1091 if dki.Managed != nil { 1092 objectMap["managed"] = dki.Managed 1093 } 1094 return json.Marshal(objectMap) 1095} 1096 1097// DeletedKeyListResult a list of keys that have been deleted in this vault. 1098type DeletedKeyListResult struct { 1099 autorest.Response `json:"-"` 1100 // Value - A response message containing a list of deleted keys in the vault along with a link to the next page of deleted keys 1101 Value *[]DeletedKeyItem `json:"value,omitempty"` 1102 // NextLink - The URL to get the next set of deleted keys. 1103 NextLink *string `json:"nextLink,omitempty"` 1104} 1105 1106// DeletedKeyListResultIterator provides access to a complete listing of DeletedKeyItem values. 1107type DeletedKeyListResultIterator struct { 1108 i int 1109 page DeletedKeyListResultPage 1110} 1111 1112// Next advances to the next value. If there was an error making 1113// the request the iterator does not advance and the error is returned. 1114func (iter *DeletedKeyListResultIterator) Next() error { 1115 iter.i++ 1116 if iter.i < len(iter.page.Values()) { 1117 return nil 1118 } 1119 err := iter.page.Next() 1120 if err != nil { 1121 iter.i-- 1122 return err 1123 } 1124 iter.i = 0 1125 return nil 1126} 1127 1128// NotDone returns true if the enumeration should be started or is not yet complete. 1129func (iter DeletedKeyListResultIterator) NotDone() bool { 1130 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1131} 1132 1133// Response returns the raw server response from the last page request. 1134func (iter DeletedKeyListResultIterator) Response() DeletedKeyListResult { 1135 return iter.page.Response() 1136} 1137 1138// Value returns the current value or a zero-initialized value if the 1139// iterator has advanced beyond the end of the collection. 1140func (iter DeletedKeyListResultIterator) Value() DeletedKeyItem { 1141 if !iter.page.NotDone() { 1142 return DeletedKeyItem{} 1143 } 1144 return iter.page.Values()[iter.i] 1145} 1146 1147// IsEmpty returns true if the ListResult contains no values. 1148func (dklr DeletedKeyListResult) IsEmpty() bool { 1149 return dklr.Value == nil || len(*dklr.Value) == 0 1150} 1151 1152// deletedKeyListResultPreparer prepares a request to retrieve the next set of results. 1153// It returns nil if no more results exist. 1154func (dklr DeletedKeyListResult) deletedKeyListResultPreparer() (*http.Request, error) { 1155 if dklr.NextLink == nil || len(to.String(dklr.NextLink)) < 1 { 1156 return nil, nil 1157 } 1158 return autorest.Prepare(&http.Request{}, 1159 autorest.AsJSON(), 1160 autorest.AsGet(), 1161 autorest.WithBaseURL(to.String(dklr.NextLink))) 1162} 1163 1164// DeletedKeyListResultPage contains a page of DeletedKeyItem values. 1165type DeletedKeyListResultPage struct { 1166 fn func(DeletedKeyListResult) (DeletedKeyListResult, error) 1167 dklr DeletedKeyListResult 1168} 1169 1170// Next advances to the next page of values. If there was an error making 1171// the request the page does not advance and the error is returned. 1172func (page *DeletedKeyListResultPage) Next() error { 1173 next, err := page.fn(page.dklr) 1174 if err != nil { 1175 return err 1176 } 1177 page.dklr = next 1178 return nil 1179} 1180 1181// NotDone returns true if the page enumeration should be started or is not yet complete. 1182func (page DeletedKeyListResultPage) NotDone() bool { 1183 return !page.dklr.IsEmpty() 1184} 1185 1186// Response returns the raw server response from the last page request. 1187func (page DeletedKeyListResultPage) Response() DeletedKeyListResult { 1188 return page.dklr 1189} 1190 1191// Values returns the slice of values for the current page or nil if there are no values. 1192func (page DeletedKeyListResultPage) Values() []DeletedKeyItem { 1193 if page.dklr.IsEmpty() { 1194 return nil 1195 } 1196 return *page.dklr.Value 1197} 1198 1199// DeletedSasDefinitionBundle a deleted SAS definition bundle consisting of its previous id, attributes and its 1200// tags, as well as information on when it will be purged. 1201type DeletedSasDefinitionBundle struct { 1202 autorest.Response `json:"-"` 1203 // RecoveryID - The url of the recovery object, used to identify and recover the deleted SAS definition. 1204 RecoveryID *string `json:"recoveryId,omitempty"` 1205 // ScheduledPurgeDate - The time when the SAS definition is scheduled to be purged, in UTC 1206 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 1207 // DeletedDate - The time when the SAS definition was deleted, in UTC 1208 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 1209 // ID - The SAS definition id. 1210 ID *string `json:"id,omitempty"` 1211 // SecretID - Storage account SAS definition secret id. 1212 SecretID *string `json:"sid,omitempty"` 1213 // TemplateURI - The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. 1214 TemplateURI *string `json:"templateUri,omitempty"` 1215 // SasType - The type of SAS token the SAS definition will create. Possible values include: 'Account', 'Service' 1216 SasType SasTokenType `json:"sasType,omitempty"` 1217 // ValidityPeriod - The validity period of SAS tokens created according to the SAS definition. 1218 ValidityPeriod *string `json:"validityPeriod,omitempty"` 1219 // Attributes - The SAS definition attributes. 1220 Attributes *SasDefinitionAttributes `json:"attributes,omitempty"` 1221 // Tags - Application specific metadata in the form of key-value pairs 1222 Tags map[string]*string `json:"tags"` 1223} 1224 1225// MarshalJSON is the custom marshaler for DeletedSasDefinitionBundle. 1226func (dsdb DeletedSasDefinitionBundle) MarshalJSON() ([]byte, error) { 1227 objectMap := make(map[string]interface{}) 1228 if dsdb.RecoveryID != nil { 1229 objectMap["recoveryId"] = dsdb.RecoveryID 1230 } 1231 if dsdb.ScheduledPurgeDate != nil { 1232 objectMap["scheduledPurgeDate"] = dsdb.ScheduledPurgeDate 1233 } 1234 if dsdb.DeletedDate != nil { 1235 objectMap["deletedDate"] = dsdb.DeletedDate 1236 } 1237 if dsdb.ID != nil { 1238 objectMap["id"] = dsdb.ID 1239 } 1240 if dsdb.SecretID != nil { 1241 objectMap["sid"] = dsdb.SecretID 1242 } 1243 if dsdb.TemplateURI != nil { 1244 objectMap["templateUri"] = dsdb.TemplateURI 1245 } 1246 if dsdb.SasType != "" { 1247 objectMap["sasType"] = dsdb.SasType 1248 } 1249 if dsdb.ValidityPeriod != nil { 1250 objectMap["validityPeriod"] = dsdb.ValidityPeriod 1251 } 1252 if dsdb.Attributes != nil { 1253 objectMap["attributes"] = dsdb.Attributes 1254 } 1255 if dsdb.Tags != nil { 1256 objectMap["tags"] = dsdb.Tags 1257 } 1258 return json.Marshal(objectMap) 1259} 1260 1261// DeletedSasDefinitionItem the deleted SAS definition item containing metadata about the deleted SAS definition. 1262type DeletedSasDefinitionItem struct { 1263 // RecoveryID - The url of the recovery object, used to identify and recover the deleted SAS definition. 1264 RecoveryID *string `json:"recoveryId,omitempty"` 1265 // ScheduledPurgeDate - The time when the SAS definition is scheduled to be purged, in UTC 1266 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 1267 // DeletedDate - The time when the SAS definition was deleted, in UTC 1268 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 1269 // ID - The storage SAS identifier. 1270 ID *string `json:"id,omitempty"` 1271 // SecretID - The storage account SAS definition secret id. 1272 SecretID *string `json:"sid,omitempty"` 1273 // Attributes - The SAS definition management attributes. 1274 Attributes *SasDefinitionAttributes `json:"attributes,omitempty"` 1275 // Tags - Application specific metadata in the form of key-value pairs. 1276 Tags map[string]*string `json:"tags"` 1277} 1278 1279// MarshalJSON is the custom marshaler for DeletedSasDefinitionItem. 1280func (dsdi DeletedSasDefinitionItem) MarshalJSON() ([]byte, error) { 1281 objectMap := make(map[string]interface{}) 1282 if dsdi.RecoveryID != nil { 1283 objectMap["recoveryId"] = dsdi.RecoveryID 1284 } 1285 if dsdi.ScheduledPurgeDate != nil { 1286 objectMap["scheduledPurgeDate"] = dsdi.ScheduledPurgeDate 1287 } 1288 if dsdi.DeletedDate != nil { 1289 objectMap["deletedDate"] = dsdi.DeletedDate 1290 } 1291 if dsdi.ID != nil { 1292 objectMap["id"] = dsdi.ID 1293 } 1294 if dsdi.SecretID != nil { 1295 objectMap["sid"] = dsdi.SecretID 1296 } 1297 if dsdi.Attributes != nil { 1298 objectMap["attributes"] = dsdi.Attributes 1299 } 1300 if dsdi.Tags != nil { 1301 objectMap["tags"] = dsdi.Tags 1302 } 1303 return json.Marshal(objectMap) 1304} 1305 1306// DeletedSasDefinitionListResult the deleted SAS definition list result 1307type DeletedSasDefinitionListResult struct { 1308 autorest.Response `json:"-"` 1309 // Value - A response message containing a list of the deleted SAS definitions in the vault along with a link to the next page of deleted sas definitions 1310 Value *[]DeletedSasDefinitionItem `json:"value,omitempty"` 1311 // NextLink - The URL to get the next set of deleted SAS definitions. 1312 NextLink *string `json:"nextLink,omitempty"` 1313} 1314 1315// DeletedSasDefinitionListResultIterator provides access to a complete listing of DeletedSasDefinitionItem values. 1316type DeletedSasDefinitionListResultIterator struct { 1317 i int 1318 page DeletedSasDefinitionListResultPage 1319} 1320 1321// Next advances to the next value. If there was an error making 1322// the request the iterator does not advance and the error is returned. 1323func (iter *DeletedSasDefinitionListResultIterator) Next() error { 1324 iter.i++ 1325 if iter.i < len(iter.page.Values()) { 1326 return nil 1327 } 1328 err := iter.page.Next() 1329 if err != nil { 1330 iter.i-- 1331 return err 1332 } 1333 iter.i = 0 1334 return nil 1335} 1336 1337// NotDone returns true if the enumeration should be started or is not yet complete. 1338func (iter DeletedSasDefinitionListResultIterator) NotDone() bool { 1339 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1340} 1341 1342// Response returns the raw server response from the last page request. 1343func (iter DeletedSasDefinitionListResultIterator) Response() DeletedSasDefinitionListResult { 1344 return iter.page.Response() 1345} 1346 1347// Value returns the current value or a zero-initialized value if the 1348// iterator has advanced beyond the end of the collection. 1349func (iter DeletedSasDefinitionListResultIterator) Value() DeletedSasDefinitionItem { 1350 if !iter.page.NotDone() { 1351 return DeletedSasDefinitionItem{} 1352 } 1353 return iter.page.Values()[iter.i] 1354} 1355 1356// IsEmpty returns true if the ListResult contains no values. 1357func (dsdlr DeletedSasDefinitionListResult) IsEmpty() bool { 1358 return dsdlr.Value == nil || len(*dsdlr.Value) == 0 1359} 1360 1361// deletedSasDefinitionListResultPreparer prepares a request to retrieve the next set of results. 1362// It returns nil if no more results exist. 1363func (dsdlr DeletedSasDefinitionListResult) deletedSasDefinitionListResultPreparer() (*http.Request, error) { 1364 if dsdlr.NextLink == nil || len(to.String(dsdlr.NextLink)) < 1 { 1365 return nil, nil 1366 } 1367 return autorest.Prepare(&http.Request{}, 1368 autorest.AsJSON(), 1369 autorest.AsGet(), 1370 autorest.WithBaseURL(to.String(dsdlr.NextLink))) 1371} 1372 1373// DeletedSasDefinitionListResultPage contains a page of DeletedSasDefinitionItem values. 1374type DeletedSasDefinitionListResultPage struct { 1375 fn func(DeletedSasDefinitionListResult) (DeletedSasDefinitionListResult, error) 1376 dsdlr DeletedSasDefinitionListResult 1377} 1378 1379// Next advances to the next page of values. If there was an error making 1380// the request the page does not advance and the error is returned. 1381func (page *DeletedSasDefinitionListResultPage) Next() error { 1382 next, err := page.fn(page.dsdlr) 1383 if err != nil { 1384 return err 1385 } 1386 page.dsdlr = next 1387 return nil 1388} 1389 1390// NotDone returns true if the page enumeration should be started or is not yet complete. 1391func (page DeletedSasDefinitionListResultPage) NotDone() bool { 1392 return !page.dsdlr.IsEmpty() 1393} 1394 1395// Response returns the raw server response from the last page request. 1396func (page DeletedSasDefinitionListResultPage) Response() DeletedSasDefinitionListResult { 1397 return page.dsdlr 1398} 1399 1400// Values returns the slice of values for the current page or nil if there are no values. 1401func (page DeletedSasDefinitionListResultPage) Values() []DeletedSasDefinitionItem { 1402 if page.dsdlr.IsEmpty() { 1403 return nil 1404 } 1405 return *page.dsdlr.Value 1406} 1407 1408// DeletedSecretBundle a Deleted Secret consisting of its previous id, attributes and its tags, as well as 1409// information on when it will be purged. 1410type DeletedSecretBundle struct { 1411 autorest.Response `json:"-"` 1412 // RecoveryID - The url of the recovery object, used to identify and recover the deleted secret. 1413 RecoveryID *string `json:"recoveryId,omitempty"` 1414 // ScheduledPurgeDate - The time when the secret is scheduled to be purged, in UTC 1415 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 1416 // DeletedDate - The time when the secret was deleted, in UTC 1417 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 1418 // Value - The secret value. 1419 Value *string `json:"value,omitempty"` 1420 // ID - The secret id. 1421 ID *string `json:"id,omitempty"` 1422 // ContentType - The content type of the secret. 1423 ContentType *string `json:"contentType,omitempty"` 1424 // Attributes - The secret management attributes. 1425 Attributes *SecretAttributes `json:"attributes,omitempty"` 1426 // Tags - Application specific metadata in the form of key-value pairs. 1427 Tags map[string]*string `json:"tags"` 1428 // Kid - If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate. 1429 Kid *string `json:"kid,omitempty"` 1430 // Managed - True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be true. 1431 Managed *bool `json:"managed,omitempty"` 1432} 1433 1434// MarshalJSON is the custom marshaler for DeletedSecretBundle. 1435func (dsb DeletedSecretBundle) MarshalJSON() ([]byte, error) { 1436 objectMap := make(map[string]interface{}) 1437 if dsb.RecoveryID != nil { 1438 objectMap["recoveryId"] = dsb.RecoveryID 1439 } 1440 if dsb.ScheduledPurgeDate != nil { 1441 objectMap["scheduledPurgeDate"] = dsb.ScheduledPurgeDate 1442 } 1443 if dsb.DeletedDate != nil { 1444 objectMap["deletedDate"] = dsb.DeletedDate 1445 } 1446 if dsb.Value != nil { 1447 objectMap["value"] = dsb.Value 1448 } 1449 if dsb.ID != nil { 1450 objectMap["id"] = dsb.ID 1451 } 1452 if dsb.ContentType != nil { 1453 objectMap["contentType"] = dsb.ContentType 1454 } 1455 if dsb.Attributes != nil { 1456 objectMap["attributes"] = dsb.Attributes 1457 } 1458 if dsb.Tags != nil { 1459 objectMap["tags"] = dsb.Tags 1460 } 1461 if dsb.Kid != nil { 1462 objectMap["kid"] = dsb.Kid 1463 } 1464 if dsb.Managed != nil { 1465 objectMap["managed"] = dsb.Managed 1466 } 1467 return json.Marshal(objectMap) 1468} 1469 1470// DeletedSecretItem the deleted secret item containing metadata about the deleted secret. 1471type DeletedSecretItem struct { 1472 // RecoveryID - The url of the recovery object, used to identify and recover the deleted secret. 1473 RecoveryID *string `json:"recoveryId,omitempty"` 1474 // ScheduledPurgeDate - The time when the secret is scheduled to be purged, in UTC 1475 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 1476 // DeletedDate - The time when the secret was deleted, in UTC 1477 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 1478 // ID - Secret identifier. 1479 ID *string `json:"id,omitempty"` 1480 // Attributes - The secret management attributes. 1481 Attributes *SecretAttributes `json:"attributes,omitempty"` 1482 // Tags - Application specific metadata in the form of key-value pairs. 1483 Tags map[string]*string `json:"tags"` 1484 // ContentType - Type of the secret value such as a password. 1485 ContentType *string `json:"contentType,omitempty"` 1486 // Managed - True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. 1487 Managed *bool `json:"managed,omitempty"` 1488} 1489 1490// MarshalJSON is the custom marshaler for DeletedSecretItem. 1491func (dsi DeletedSecretItem) MarshalJSON() ([]byte, error) { 1492 objectMap := make(map[string]interface{}) 1493 if dsi.RecoveryID != nil { 1494 objectMap["recoveryId"] = dsi.RecoveryID 1495 } 1496 if dsi.ScheduledPurgeDate != nil { 1497 objectMap["scheduledPurgeDate"] = dsi.ScheduledPurgeDate 1498 } 1499 if dsi.DeletedDate != nil { 1500 objectMap["deletedDate"] = dsi.DeletedDate 1501 } 1502 if dsi.ID != nil { 1503 objectMap["id"] = dsi.ID 1504 } 1505 if dsi.Attributes != nil { 1506 objectMap["attributes"] = dsi.Attributes 1507 } 1508 if dsi.Tags != nil { 1509 objectMap["tags"] = dsi.Tags 1510 } 1511 if dsi.ContentType != nil { 1512 objectMap["contentType"] = dsi.ContentType 1513 } 1514 if dsi.Managed != nil { 1515 objectMap["managed"] = dsi.Managed 1516 } 1517 return json.Marshal(objectMap) 1518} 1519 1520// DeletedSecretListResult the deleted secret list result 1521type DeletedSecretListResult struct { 1522 autorest.Response `json:"-"` 1523 // Value - A response message containing a list of the deleted secrets in the vault along with a link to the next page of deleted secrets 1524 Value *[]DeletedSecretItem `json:"value,omitempty"` 1525 // NextLink - The URL to get the next set of deleted secrets. 1526 NextLink *string `json:"nextLink,omitempty"` 1527} 1528 1529// DeletedSecretListResultIterator provides access to a complete listing of DeletedSecretItem values. 1530type DeletedSecretListResultIterator struct { 1531 i int 1532 page DeletedSecretListResultPage 1533} 1534 1535// Next advances to the next value. If there was an error making 1536// the request the iterator does not advance and the error is returned. 1537func (iter *DeletedSecretListResultIterator) Next() error { 1538 iter.i++ 1539 if iter.i < len(iter.page.Values()) { 1540 return nil 1541 } 1542 err := iter.page.Next() 1543 if err != nil { 1544 iter.i-- 1545 return err 1546 } 1547 iter.i = 0 1548 return nil 1549} 1550 1551// NotDone returns true if the enumeration should be started or is not yet complete. 1552func (iter DeletedSecretListResultIterator) NotDone() bool { 1553 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1554} 1555 1556// Response returns the raw server response from the last page request. 1557func (iter DeletedSecretListResultIterator) Response() DeletedSecretListResult { 1558 return iter.page.Response() 1559} 1560 1561// Value returns the current value or a zero-initialized value if the 1562// iterator has advanced beyond the end of the collection. 1563func (iter DeletedSecretListResultIterator) Value() DeletedSecretItem { 1564 if !iter.page.NotDone() { 1565 return DeletedSecretItem{} 1566 } 1567 return iter.page.Values()[iter.i] 1568} 1569 1570// IsEmpty returns true if the ListResult contains no values. 1571func (dslr DeletedSecretListResult) IsEmpty() bool { 1572 return dslr.Value == nil || len(*dslr.Value) == 0 1573} 1574 1575// deletedSecretListResultPreparer prepares a request to retrieve the next set of results. 1576// It returns nil if no more results exist. 1577func (dslr DeletedSecretListResult) deletedSecretListResultPreparer() (*http.Request, error) { 1578 if dslr.NextLink == nil || len(to.String(dslr.NextLink)) < 1 { 1579 return nil, nil 1580 } 1581 return autorest.Prepare(&http.Request{}, 1582 autorest.AsJSON(), 1583 autorest.AsGet(), 1584 autorest.WithBaseURL(to.String(dslr.NextLink))) 1585} 1586 1587// DeletedSecretListResultPage contains a page of DeletedSecretItem values. 1588type DeletedSecretListResultPage struct { 1589 fn func(DeletedSecretListResult) (DeletedSecretListResult, error) 1590 dslr DeletedSecretListResult 1591} 1592 1593// Next advances to the next page of values. If there was an error making 1594// the request the page does not advance and the error is returned. 1595func (page *DeletedSecretListResultPage) Next() error { 1596 next, err := page.fn(page.dslr) 1597 if err != nil { 1598 return err 1599 } 1600 page.dslr = next 1601 return nil 1602} 1603 1604// NotDone returns true if the page enumeration should be started or is not yet complete. 1605func (page DeletedSecretListResultPage) NotDone() bool { 1606 return !page.dslr.IsEmpty() 1607} 1608 1609// Response returns the raw server response from the last page request. 1610func (page DeletedSecretListResultPage) Response() DeletedSecretListResult { 1611 return page.dslr 1612} 1613 1614// Values returns the slice of values for the current page or nil if there are no values. 1615func (page DeletedSecretListResultPage) Values() []DeletedSecretItem { 1616 if page.dslr.IsEmpty() { 1617 return nil 1618 } 1619 return *page.dslr.Value 1620} 1621 1622// DeletedStorageAccountItem the deleted storage account item containing metadata about the deleted storage 1623// account. 1624type DeletedStorageAccountItem struct { 1625 // RecoveryID - The url of the recovery object, used to identify and recover the deleted storage account. 1626 RecoveryID *string `json:"recoveryId,omitempty"` 1627 // ScheduledPurgeDate - The time when the storage account is scheduled to be purged, in UTC 1628 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 1629 // DeletedDate - The time when the storage account was deleted, in UTC 1630 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 1631 // ID - Storage identifier. 1632 ID *string `json:"id,omitempty"` 1633 // ResourceID - Storage account resource Id. 1634 ResourceID *string `json:"resourceId,omitempty"` 1635 // Attributes - The storage account management attributes. 1636 Attributes *StorageAccountAttributes `json:"attributes,omitempty"` 1637 // Tags - Application specific metadata in the form of key-value pairs. 1638 Tags map[string]*string `json:"tags"` 1639} 1640 1641// MarshalJSON is the custom marshaler for DeletedStorageAccountItem. 1642func (dsai DeletedStorageAccountItem) MarshalJSON() ([]byte, error) { 1643 objectMap := make(map[string]interface{}) 1644 if dsai.RecoveryID != nil { 1645 objectMap["recoveryId"] = dsai.RecoveryID 1646 } 1647 if dsai.ScheduledPurgeDate != nil { 1648 objectMap["scheduledPurgeDate"] = dsai.ScheduledPurgeDate 1649 } 1650 if dsai.DeletedDate != nil { 1651 objectMap["deletedDate"] = dsai.DeletedDate 1652 } 1653 if dsai.ID != nil { 1654 objectMap["id"] = dsai.ID 1655 } 1656 if dsai.ResourceID != nil { 1657 objectMap["resourceId"] = dsai.ResourceID 1658 } 1659 if dsai.Attributes != nil { 1660 objectMap["attributes"] = dsai.Attributes 1661 } 1662 if dsai.Tags != nil { 1663 objectMap["tags"] = dsai.Tags 1664 } 1665 return json.Marshal(objectMap) 1666} 1667 1668// DeletedStorageBundle a deleted storage account bundle consisting of its previous id, attributes and its tags, as 1669// well as information on when it will be purged. 1670type DeletedStorageBundle struct { 1671 autorest.Response `json:"-"` 1672 // RecoveryID - The url of the recovery object, used to identify and recover the deleted storage account. 1673 RecoveryID *string `json:"recoveryId,omitempty"` 1674 // ScheduledPurgeDate - The time when the storage account is scheduled to be purged, in UTC 1675 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 1676 // DeletedDate - The time when the storage account was deleted, in UTC 1677 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 1678 // ID - The storage account id. 1679 ID *string `json:"id,omitempty"` 1680 // ResourceID - The storage account resource id. 1681 ResourceID *string `json:"resourceId,omitempty"` 1682 // ActiveKeyName - The current active storage account key name. 1683 ActiveKeyName *string `json:"activeKeyName,omitempty"` 1684 // AutoRegenerateKey - whether keyvault should manage the storage account for the user. 1685 AutoRegenerateKey *bool `json:"autoRegenerateKey,omitempty"` 1686 // RegenerationPeriod - The key regeneration time duration specified in ISO-8601 format. 1687 RegenerationPeriod *string `json:"regenerationPeriod,omitempty"` 1688 // Attributes - The storage account attributes. 1689 Attributes *StorageAccountAttributes `json:"attributes,omitempty"` 1690 // Tags - Application specific metadata in the form of key-value pairs 1691 Tags map[string]*string `json:"tags"` 1692} 1693 1694// MarshalJSON is the custom marshaler for DeletedStorageBundle. 1695func (dsb DeletedStorageBundle) MarshalJSON() ([]byte, error) { 1696 objectMap := make(map[string]interface{}) 1697 if dsb.RecoveryID != nil { 1698 objectMap["recoveryId"] = dsb.RecoveryID 1699 } 1700 if dsb.ScheduledPurgeDate != nil { 1701 objectMap["scheduledPurgeDate"] = dsb.ScheduledPurgeDate 1702 } 1703 if dsb.DeletedDate != nil { 1704 objectMap["deletedDate"] = dsb.DeletedDate 1705 } 1706 if dsb.ID != nil { 1707 objectMap["id"] = dsb.ID 1708 } 1709 if dsb.ResourceID != nil { 1710 objectMap["resourceId"] = dsb.ResourceID 1711 } 1712 if dsb.ActiveKeyName != nil { 1713 objectMap["activeKeyName"] = dsb.ActiveKeyName 1714 } 1715 if dsb.AutoRegenerateKey != nil { 1716 objectMap["autoRegenerateKey"] = dsb.AutoRegenerateKey 1717 } 1718 if dsb.RegenerationPeriod != nil { 1719 objectMap["regenerationPeriod"] = dsb.RegenerationPeriod 1720 } 1721 if dsb.Attributes != nil { 1722 objectMap["attributes"] = dsb.Attributes 1723 } 1724 if dsb.Tags != nil { 1725 objectMap["tags"] = dsb.Tags 1726 } 1727 return json.Marshal(objectMap) 1728} 1729 1730// DeletedStorageListResult the deleted storage account list result 1731type DeletedStorageListResult struct { 1732 autorest.Response `json:"-"` 1733 // Value - A response message containing a list of the deleted storage accounts in the vault along with a link to the next page of deleted storage accounts 1734 Value *[]DeletedStorageAccountItem `json:"value,omitempty"` 1735 // NextLink - The URL to get the next set of deleted storage accounts. 1736 NextLink *string `json:"nextLink,omitempty"` 1737} 1738 1739// DeletedStorageListResultIterator provides access to a complete listing of DeletedStorageAccountItem values. 1740type DeletedStorageListResultIterator struct { 1741 i int 1742 page DeletedStorageListResultPage 1743} 1744 1745// Next advances to the next value. If there was an error making 1746// the request the iterator does not advance and the error is returned. 1747func (iter *DeletedStorageListResultIterator) Next() error { 1748 iter.i++ 1749 if iter.i < len(iter.page.Values()) { 1750 return nil 1751 } 1752 err := iter.page.Next() 1753 if err != nil { 1754 iter.i-- 1755 return err 1756 } 1757 iter.i = 0 1758 return nil 1759} 1760 1761// NotDone returns true if the enumeration should be started or is not yet complete. 1762func (iter DeletedStorageListResultIterator) NotDone() bool { 1763 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1764} 1765 1766// Response returns the raw server response from the last page request. 1767func (iter DeletedStorageListResultIterator) Response() DeletedStorageListResult { 1768 return iter.page.Response() 1769} 1770 1771// Value returns the current value or a zero-initialized value if the 1772// iterator has advanced beyond the end of the collection. 1773func (iter DeletedStorageListResultIterator) Value() DeletedStorageAccountItem { 1774 if !iter.page.NotDone() { 1775 return DeletedStorageAccountItem{} 1776 } 1777 return iter.page.Values()[iter.i] 1778} 1779 1780// IsEmpty returns true if the ListResult contains no values. 1781func (dslr DeletedStorageListResult) IsEmpty() bool { 1782 return dslr.Value == nil || len(*dslr.Value) == 0 1783} 1784 1785// deletedStorageListResultPreparer prepares a request to retrieve the next set of results. 1786// It returns nil if no more results exist. 1787func (dslr DeletedStorageListResult) deletedStorageListResultPreparer() (*http.Request, error) { 1788 if dslr.NextLink == nil || len(to.String(dslr.NextLink)) < 1 { 1789 return nil, nil 1790 } 1791 return autorest.Prepare(&http.Request{}, 1792 autorest.AsJSON(), 1793 autorest.AsGet(), 1794 autorest.WithBaseURL(to.String(dslr.NextLink))) 1795} 1796 1797// DeletedStorageListResultPage contains a page of DeletedStorageAccountItem values. 1798type DeletedStorageListResultPage struct { 1799 fn func(DeletedStorageListResult) (DeletedStorageListResult, error) 1800 dslr DeletedStorageListResult 1801} 1802 1803// Next advances to the next page of values. If there was an error making 1804// the request the page does not advance and the error is returned. 1805func (page *DeletedStorageListResultPage) Next() error { 1806 next, err := page.fn(page.dslr) 1807 if err != nil { 1808 return err 1809 } 1810 page.dslr = next 1811 return nil 1812} 1813 1814// NotDone returns true if the page enumeration should be started or is not yet complete. 1815func (page DeletedStorageListResultPage) NotDone() bool { 1816 return !page.dslr.IsEmpty() 1817} 1818 1819// Response returns the raw server response from the last page request. 1820func (page DeletedStorageListResultPage) Response() DeletedStorageListResult { 1821 return page.dslr 1822} 1823 1824// Values returns the slice of values for the current page or nil if there are no values. 1825func (page DeletedStorageListResultPage) Values() []DeletedStorageAccountItem { 1826 if page.dslr.IsEmpty() { 1827 return nil 1828 } 1829 return *page.dslr.Value 1830} 1831 1832// Error the key vault server error. 1833type Error struct { 1834 // Code - The error code. 1835 Code *string `json:"code,omitempty"` 1836 // Message - The error message. 1837 Message *string `json:"message,omitempty"` 1838 InnerError *Error `json:"innererror,omitempty"` 1839} 1840 1841// ErrorType the key vault error exception. 1842type ErrorType struct { 1843 Error *Error `json:"error,omitempty"` 1844} 1845 1846// IssuerAttributes the attributes of an issuer managed by the Key Vault service. 1847type IssuerAttributes struct { 1848 // Enabled - Determines whether the issuer is enabled. 1849 Enabled *bool `json:"enabled,omitempty"` 1850 // Created - Creation time in UTC. 1851 Created *date.UnixTime `json:"created,omitempty"` 1852 // Updated - Last updated time in UTC. 1853 Updated *date.UnixTime `json:"updated,omitempty"` 1854} 1855 1856// IssuerBundle the issuer for Key Vault certificate. 1857type IssuerBundle struct { 1858 autorest.Response `json:"-"` 1859 // ID - Identifier for the issuer object. 1860 ID *string `json:"id,omitempty"` 1861 // Provider - The issuer provider. 1862 Provider *string `json:"provider,omitempty"` 1863 // Credentials - The credentials to be used for the issuer. 1864 Credentials *IssuerCredentials `json:"credentials,omitempty"` 1865 // OrganizationDetails - Details of the organization as provided to the issuer. 1866 OrganizationDetails *OrganizationDetails `json:"org_details,omitempty"` 1867 // Attributes - Attributes of the issuer object. 1868 Attributes *IssuerAttributes `json:"attributes,omitempty"` 1869} 1870 1871// IssuerCredentials the credentials to be used for the certificate issuer. 1872type IssuerCredentials struct { 1873 // AccountID - The user name/account name/account id. 1874 AccountID *string `json:"account_id,omitempty"` 1875 // Password - The password/secret/account key. 1876 Password *string `json:"pwd,omitempty"` 1877} 1878 1879// IssuerParameters parameters for the issuer of the X509 component of a certificate. 1880type IssuerParameters struct { 1881 // Name - Name of the referenced issuer object or reserved names; for example, 'Self' or 'Unknown'. 1882 Name *string `json:"name,omitempty"` 1883 // CertificateType - Type of certificate to be requested from the issuer provider. 1884 CertificateType *string `json:"cty,omitempty"` 1885} 1886 1887// JSONWebKey as of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18 1888type JSONWebKey struct { 1889 // Kid - Key identifier. 1890 Kid *string `json:"kid,omitempty"` 1891 // Kty - JsonWebKey key type (kty). Possible values include: 'EC', 'ECHSM', 'RSA', 'RSAHSM', 'Oct' 1892 Kty JSONWebKeyType `json:"kty,omitempty"` 1893 KeyOps *[]string `json:"key_ops,omitempty"` 1894 // N - RSA modulus. 1895 N *string `json:"n,omitempty"` 1896 // E - RSA public exponent. 1897 E *string `json:"e,omitempty"` 1898 // D - RSA private exponent, or the D component of an EC private key. 1899 D *string `json:"d,omitempty"` 1900 // DP - RSA private key parameter. 1901 DP *string `json:"dp,omitempty"` 1902 // DQ - RSA private key parameter. 1903 DQ *string `json:"dq,omitempty"` 1904 // QI - RSA private key parameter. 1905 QI *string `json:"qi,omitempty"` 1906 // P - RSA secret prime. 1907 P *string `json:"p,omitempty"` 1908 // Q - RSA secret prime, with p < q. 1909 Q *string `json:"q,omitempty"` 1910 // K - Symmetric key. 1911 K *string `json:"k,omitempty"` 1912 // T - HSM Token, used with 'Bring Your Own Key'. 1913 T *string `json:"key_hsm,omitempty"` 1914 // Crv - Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P256', 'P384', 'P521', 'SECP256K1' 1915 Crv JSONWebKeyCurveName `json:"crv,omitempty"` 1916 // X - X component of an EC public key. 1917 X *string `json:"x,omitempty"` 1918 // Y - Y component of an EC public key. 1919 Y *string `json:"y,omitempty"` 1920} 1921 1922// KeyAttributes the attributes of a key managed by the key vault service. 1923type KeyAttributes struct { 1924 // RecoveryLevel - Reflects the deletion recovery level currently in effect for keys in the current vault. If it contains 'Purgeable' the key can be permanently deleted by a privileged user; otherwise, only the system can purge the key, at the end of the retention interval. Possible values include: 'Purgeable', 'RecoverablePurgeable', 'Recoverable', 'RecoverableProtectedSubscription' 1925 RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` 1926 // Enabled - Determines whether the object is enabled. 1927 Enabled *bool `json:"enabled,omitempty"` 1928 // NotBefore - Not before date in UTC. 1929 NotBefore *date.UnixTime `json:"nbf,omitempty"` 1930 // Expires - Expiry date in UTC. 1931 Expires *date.UnixTime `json:"exp,omitempty"` 1932 // Created - Creation time in UTC. 1933 Created *date.UnixTime `json:"created,omitempty"` 1934 // Updated - Last updated time in UTC. 1935 Updated *date.UnixTime `json:"updated,omitempty"` 1936} 1937 1938// KeyBundle a KeyBundle consisting of a WebKey plus its attributes. 1939type KeyBundle struct { 1940 autorest.Response `json:"-"` 1941 // Key - The Json web key. 1942 Key *JSONWebKey `json:"key,omitempty"` 1943 // Attributes - The key management attributes. 1944 Attributes *KeyAttributes `json:"attributes,omitempty"` 1945 // Tags - Application specific metadata in the form of key-value pairs. 1946 Tags map[string]*string `json:"tags"` 1947 // Managed - True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. 1948 Managed *bool `json:"managed,omitempty"` 1949} 1950 1951// MarshalJSON is the custom marshaler for KeyBundle. 1952func (kb KeyBundle) MarshalJSON() ([]byte, error) { 1953 objectMap := make(map[string]interface{}) 1954 if kb.Key != nil { 1955 objectMap["key"] = kb.Key 1956 } 1957 if kb.Attributes != nil { 1958 objectMap["attributes"] = kb.Attributes 1959 } 1960 if kb.Tags != nil { 1961 objectMap["tags"] = kb.Tags 1962 } 1963 if kb.Managed != nil { 1964 objectMap["managed"] = kb.Managed 1965 } 1966 return json.Marshal(objectMap) 1967} 1968 1969// KeyCreateParameters the key create parameters. 1970type KeyCreateParameters struct { 1971 // Kty - The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'ECHSM', 'RSA', 'RSAHSM', 'Oct' 1972 Kty JSONWebKeyType `json:"kty,omitempty"` 1973 // KeySize - The key size in bytes. For example, 1024 or 2048. 1974 KeySize *int32 `json:"key_size,omitempty"` 1975 KeyOps *[]JSONWebKeyOperation `json:"key_ops,omitempty"` 1976 KeyAttributes *KeyAttributes `json:"attributes,omitempty"` 1977 // Tags - Application specific metadata in the form of key-value pairs. 1978 Tags map[string]*string `json:"tags"` 1979 // Curve - Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P256', 'P384', 'P521', 'SECP256K1' 1980 Curve JSONWebKeyCurveName `json:"crv,omitempty"` 1981} 1982 1983// MarshalJSON is the custom marshaler for KeyCreateParameters. 1984func (kcp KeyCreateParameters) MarshalJSON() ([]byte, error) { 1985 objectMap := make(map[string]interface{}) 1986 if kcp.Kty != "" { 1987 objectMap["kty"] = kcp.Kty 1988 } 1989 if kcp.KeySize != nil { 1990 objectMap["key_size"] = kcp.KeySize 1991 } 1992 if kcp.KeyOps != nil { 1993 objectMap["key_ops"] = kcp.KeyOps 1994 } 1995 if kcp.KeyAttributes != nil { 1996 objectMap["attributes"] = kcp.KeyAttributes 1997 } 1998 if kcp.Tags != nil { 1999 objectMap["tags"] = kcp.Tags 2000 } 2001 if kcp.Curve != "" { 2002 objectMap["crv"] = kcp.Curve 2003 } 2004 return json.Marshal(objectMap) 2005} 2006 2007// KeyImportParameters the key import parameters. 2008type KeyImportParameters struct { 2009 // Hsm - Whether to import as a hardware key (HSM) or software key. 2010 Hsm *bool `json:"Hsm,omitempty"` 2011 // Key - The Json web key 2012 Key *JSONWebKey `json:"key,omitempty"` 2013 // KeyAttributes - The key management attributes. 2014 KeyAttributes *KeyAttributes `json:"attributes,omitempty"` 2015 // Tags - Application specific metadata in the form of key-value pairs. 2016 Tags map[string]*string `json:"tags"` 2017} 2018 2019// MarshalJSON is the custom marshaler for KeyImportParameters. 2020func (kip KeyImportParameters) MarshalJSON() ([]byte, error) { 2021 objectMap := make(map[string]interface{}) 2022 if kip.Hsm != nil { 2023 objectMap["Hsm"] = kip.Hsm 2024 } 2025 if kip.Key != nil { 2026 objectMap["key"] = kip.Key 2027 } 2028 if kip.KeyAttributes != nil { 2029 objectMap["attributes"] = kip.KeyAttributes 2030 } 2031 if kip.Tags != nil { 2032 objectMap["tags"] = kip.Tags 2033 } 2034 return json.Marshal(objectMap) 2035} 2036 2037// KeyItem the key item containing key metadata. 2038type KeyItem struct { 2039 // Kid - Key identifier. 2040 Kid *string `json:"kid,omitempty"` 2041 // Attributes - The key management attributes. 2042 Attributes *KeyAttributes `json:"attributes,omitempty"` 2043 // Tags - Application specific metadata in the form of key-value pairs. 2044 Tags map[string]*string `json:"tags"` 2045 // Managed - True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. 2046 Managed *bool `json:"managed,omitempty"` 2047} 2048 2049// MarshalJSON is the custom marshaler for KeyItem. 2050func (ki KeyItem) MarshalJSON() ([]byte, error) { 2051 objectMap := make(map[string]interface{}) 2052 if ki.Kid != nil { 2053 objectMap["kid"] = ki.Kid 2054 } 2055 if ki.Attributes != nil { 2056 objectMap["attributes"] = ki.Attributes 2057 } 2058 if ki.Tags != nil { 2059 objectMap["tags"] = ki.Tags 2060 } 2061 if ki.Managed != nil { 2062 objectMap["managed"] = ki.Managed 2063 } 2064 return json.Marshal(objectMap) 2065} 2066 2067// KeyListResult the key list result. 2068type KeyListResult struct { 2069 autorest.Response `json:"-"` 2070 // Value - A response message containing a list of keys in the key vault along with a link to the next page of keys. 2071 Value *[]KeyItem `json:"value,omitempty"` 2072 // NextLink - The URL to get the next set of keys. 2073 NextLink *string `json:"nextLink,omitempty"` 2074} 2075 2076// KeyListResultIterator provides access to a complete listing of KeyItem values. 2077type KeyListResultIterator struct { 2078 i int 2079 page KeyListResultPage 2080} 2081 2082// Next advances to the next value. If there was an error making 2083// the request the iterator does not advance and the error is returned. 2084func (iter *KeyListResultIterator) Next() error { 2085 iter.i++ 2086 if iter.i < len(iter.page.Values()) { 2087 return nil 2088 } 2089 err := iter.page.Next() 2090 if err != nil { 2091 iter.i-- 2092 return err 2093 } 2094 iter.i = 0 2095 return nil 2096} 2097 2098// NotDone returns true if the enumeration should be started or is not yet complete. 2099func (iter KeyListResultIterator) NotDone() bool { 2100 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2101} 2102 2103// Response returns the raw server response from the last page request. 2104func (iter KeyListResultIterator) Response() KeyListResult { 2105 return iter.page.Response() 2106} 2107 2108// Value returns the current value or a zero-initialized value if the 2109// iterator has advanced beyond the end of the collection. 2110func (iter KeyListResultIterator) Value() KeyItem { 2111 if !iter.page.NotDone() { 2112 return KeyItem{} 2113 } 2114 return iter.page.Values()[iter.i] 2115} 2116 2117// IsEmpty returns true if the ListResult contains no values. 2118func (klr KeyListResult) IsEmpty() bool { 2119 return klr.Value == nil || len(*klr.Value) == 0 2120} 2121 2122// keyListResultPreparer prepares a request to retrieve the next set of results. 2123// It returns nil if no more results exist. 2124func (klr KeyListResult) keyListResultPreparer() (*http.Request, error) { 2125 if klr.NextLink == nil || len(to.String(klr.NextLink)) < 1 { 2126 return nil, nil 2127 } 2128 return autorest.Prepare(&http.Request{}, 2129 autorest.AsJSON(), 2130 autorest.AsGet(), 2131 autorest.WithBaseURL(to.String(klr.NextLink))) 2132} 2133 2134// KeyListResultPage contains a page of KeyItem values. 2135type KeyListResultPage struct { 2136 fn func(KeyListResult) (KeyListResult, error) 2137 klr KeyListResult 2138} 2139 2140// Next advances to the next page of values. If there was an error making 2141// the request the page does not advance and the error is returned. 2142func (page *KeyListResultPage) Next() error { 2143 next, err := page.fn(page.klr) 2144 if err != nil { 2145 return err 2146 } 2147 page.klr = next 2148 return nil 2149} 2150 2151// NotDone returns true if the page enumeration should be started or is not yet complete. 2152func (page KeyListResultPage) NotDone() bool { 2153 return !page.klr.IsEmpty() 2154} 2155 2156// Response returns the raw server response from the last page request. 2157func (page KeyListResultPage) Response() KeyListResult { 2158 return page.klr 2159} 2160 2161// Values returns the slice of values for the current page or nil if there are no values. 2162func (page KeyListResultPage) Values() []KeyItem { 2163 if page.klr.IsEmpty() { 2164 return nil 2165 } 2166 return *page.klr.Value 2167} 2168 2169// KeyOperationResult the key operation result. 2170type KeyOperationResult struct { 2171 autorest.Response `json:"-"` 2172 // Kid - Key identifier 2173 Kid *string `json:"kid,omitempty"` 2174 Result *string `json:"value,omitempty"` 2175} 2176 2177// KeyOperationsParameters the key operations parameters. 2178type KeyOperationsParameters struct { 2179 // Algorithm - algorithm identifier. Possible values include: 'RSAOAEP', 'RSAOAEP256', 'RSA15' 2180 Algorithm JSONWebKeyEncryptionAlgorithm `json:"alg,omitempty"` 2181 Value *string `json:"value,omitempty"` 2182} 2183 2184// KeyProperties properties of the key pair backing a certificate. 2185type KeyProperties struct { 2186 // Exportable - Indicates if the private key can be exported. 2187 Exportable *bool `json:"exportable,omitempty"` 2188 // KeyType - The key type. 2189 KeyType *string `json:"kty,omitempty"` 2190 // KeySize - The key size in bytes. For example; 1024 or 2048. 2191 KeySize *int32 `json:"key_size,omitempty"` 2192 // ReuseKey - Indicates if the same key pair will be used on certificate renewal. 2193 ReuseKey *bool `json:"reuse_key,omitempty"` 2194} 2195 2196// KeyRestoreParameters the key restore parameters. 2197type KeyRestoreParameters struct { 2198 // KeyBundleBackup - The backup blob associated with a key bundle. 2199 KeyBundleBackup *string `json:"value,omitempty"` 2200} 2201 2202// KeySignParameters the key operations parameters. 2203type KeySignParameters struct { 2204 // Algorithm - The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' 2205 Algorithm JSONWebKeySignatureAlgorithm `json:"alg,omitempty"` 2206 Value *string `json:"value,omitempty"` 2207} 2208 2209// KeyUpdateParameters the key update parameters. 2210type KeyUpdateParameters struct { 2211 // KeyOps - Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. 2212 KeyOps *[]JSONWebKeyOperation `json:"key_ops,omitempty"` 2213 KeyAttributes *KeyAttributes `json:"attributes,omitempty"` 2214 // Tags - Application specific metadata in the form of key-value pairs. 2215 Tags map[string]*string `json:"tags"` 2216} 2217 2218// MarshalJSON is the custom marshaler for KeyUpdateParameters. 2219func (kup KeyUpdateParameters) MarshalJSON() ([]byte, error) { 2220 objectMap := make(map[string]interface{}) 2221 if kup.KeyOps != nil { 2222 objectMap["key_ops"] = kup.KeyOps 2223 } 2224 if kup.KeyAttributes != nil { 2225 objectMap["attributes"] = kup.KeyAttributes 2226 } 2227 if kup.Tags != nil { 2228 objectMap["tags"] = kup.Tags 2229 } 2230 return json.Marshal(objectMap) 2231} 2232 2233// KeyVerifyParameters the key verify parameters. 2234type KeyVerifyParameters struct { 2235 // Algorithm - The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' 2236 Algorithm JSONWebKeySignatureAlgorithm `json:"alg,omitempty"` 2237 // Digest - The digest used for signing. 2238 Digest *string `json:"digest,omitempty"` 2239 // Signature - The signature to be verified. 2240 Signature *string `json:"value,omitempty"` 2241} 2242 2243// KeyVerifyResult the key verify result. 2244type KeyVerifyResult struct { 2245 autorest.Response `json:"-"` 2246 // Value - True if the signature is verified, otherwise false. 2247 Value *bool `json:"value,omitempty"` 2248} 2249 2250// LifetimeAction action and its trigger that will be performed by Key Vault over the lifetime of a certificate. 2251type LifetimeAction struct { 2252 // Trigger - The condition that will execute the action. 2253 Trigger *Trigger `json:"trigger,omitempty"` 2254 // Action - The action that will be executed. 2255 Action *Action `json:"action,omitempty"` 2256} 2257 2258// OrganizationDetails details of the organization of the certificate issuer. 2259type OrganizationDetails struct { 2260 // ID - Id of the organization. 2261 ID *string `json:"id,omitempty"` 2262 // AdminDetails - Details of the organization administrator. 2263 AdminDetails *[]AdministratorDetails `json:"admin_details,omitempty"` 2264} 2265 2266// PendingCertificateSigningRequestResult the pending certificate signing request result. 2267type PendingCertificateSigningRequestResult struct { 2268 // Value - The pending certificate signing request as Base64 encoded string. 2269 Value *string `json:"value,omitempty"` 2270} 2271 2272// SasDefinitionAttributes the SAS definition management attributes. 2273type SasDefinitionAttributes struct { 2274 // Enabled - the enabled state of the object. 2275 Enabled *bool `json:"enabled,omitempty"` 2276 // Created - Creation time in UTC. 2277 Created *date.UnixTime `json:"created,omitempty"` 2278 // Updated - Last updated time in UTC. 2279 Updated *date.UnixTime `json:"updated,omitempty"` 2280 // RecoveryLevel - Reflects the deletion recovery level currently in effect for SAS definitions in the current vault. If it contains 'Purgeable' the SAS definition can be permanently deleted by a privileged user; otherwise, only the system can purge the SAS definition, at the end of the retention interval. Possible values include: 'Purgeable', 'RecoverablePurgeable', 'Recoverable', 'RecoverableProtectedSubscription' 2281 RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` 2282} 2283 2284// SasDefinitionBundle a SAS definition bundle consists of key vault SAS definition details plus its attributes. 2285type SasDefinitionBundle struct { 2286 autorest.Response `json:"-"` 2287 // ID - The SAS definition id. 2288 ID *string `json:"id,omitempty"` 2289 // SecretID - Storage account SAS definition secret id. 2290 SecretID *string `json:"sid,omitempty"` 2291 // TemplateURI - The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. 2292 TemplateURI *string `json:"templateUri,omitempty"` 2293 // SasType - The type of SAS token the SAS definition will create. Possible values include: 'Account', 'Service' 2294 SasType SasTokenType `json:"sasType,omitempty"` 2295 // ValidityPeriod - The validity period of SAS tokens created according to the SAS definition. 2296 ValidityPeriod *string `json:"validityPeriod,omitempty"` 2297 // Attributes - The SAS definition attributes. 2298 Attributes *SasDefinitionAttributes `json:"attributes,omitempty"` 2299 // Tags - Application specific metadata in the form of key-value pairs 2300 Tags map[string]*string `json:"tags"` 2301} 2302 2303// MarshalJSON is the custom marshaler for SasDefinitionBundle. 2304func (sdb SasDefinitionBundle) MarshalJSON() ([]byte, error) { 2305 objectMap := make(map[string]interface{}) 2306 if sdb.ID != nil { 2307 objectMap["id"] = sdb.ID 2308 } 2309 if sdb.SecretID != nil { 2310 objectMap["sid"] = sdb.SecretID 2311 } 2312 if sdb.TemplateURI != nil { 2313 objectMap["templateUri"] = sdb.TemplateURI 2314 } 2315 if sdb.SasType != "" { 2316 objectMap["sasType"] = sdb.SasType 2317 } 2318 if sdb.ValidityPeriod != nil { 2319 objectMap["validityPeriod"] = sdb.ValidityPeriod 2320 } 2321 if sdb.Attributes != nil { 2322 objectMap["attributes"] = sdb.Attributes 2323 } 2324 if sdb.Tags != nil { 2325 objectMap["tags"] = sdb.Tags 2326 } 2327 return json.Marshal(objectMap) 2328} 2329 2330// SasDefinitionCreateParameters the SAS definition create parameters. 2331type SasDefinitionCreateParameters struct { 2332 // TemplateURI - The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. 2333 TemplateURI *string `json:"templateUri,omitempty"` 2334 // SasType - The type of SAS token the SAS definition will create. Possible values include: 'Account', 'Service' 2335 SasType SasTokenType `json:"sasType,omitempty"` 2336 // ValidityPeriod - The validity period of SAS tokens created according to the SAS definition. 2337 ValidityPeriod *string `json:"validityPeriod,omitempty"` 2338 // SasDefinitionAttributes - The attributes of the SAS definition. 2339 SasDefinitionAttributes *SasDefinitionAttributes `json:"attributes,omitempty"` 2340 // Tags - Application specific metadata in the form of key-value pairs. 2341 Tags map[string]*string `json:"tags"` 2342} 2343 2344// MarshalJSON is the custom marshaler for SasDefinitionCreateParameters. 2345func (sdcp SasDefinitionCreateParameters) MarshalJSON() ([]byte, error) { 2346 objectMap := make(map[string]interface{}) 2347 if sdcp.TemplateURI != nil { 2348 objectMap["templateUri"] = sdcp.TemplateURI 2349 } 2350 if sdcp.SasType != "" { 2351 objectMap["sasType"] = sdcp.SasType 2352 } 2353 if sdcp.ValidityPeriod != nil { 2354 objectMap["validityPeriod"] = sdcp.ValidityPeriod 2355 } 2356 if sdcp.SasDefinitionAttributes != nil { 2357 objectMap["attributes"] = sdcp.SasDefinitionAttributes 2358 } 2359 if sdcp.Tags != nil { 2360 objectMap["tags"] = sdcp.Tags 2361 } 2362 return json.Marshal(objectMap) 2363} 2364 2365// SasDefinitionItem the SAS definition item containing storage SAS definition metadata. 2366type SasDefinitionItem struct { 2367 // ID - The storage SAS identifier. 2368 ID *string `json:"id,omitempty"` 2369 // SecretID - The storage account SAS definition secret id. 2370 SecretID *string `json:"sid,omitempty"` 2371 // Attributes - The SAS definition management attributes. 2372 Attributes *SasDefinitionAttributes `json:"attributes,omitempty"` 2373 // Tags - Application specific metadata in the form of key-value pairs. 2374 Tags map[string]*string `json:"tags"` 2375} 2376 2377// MarshalJSON is the custom marshaler for SasDefinitionItem. 2378func (sdi SasDefinitionItem) MarshalJSON() ([]byte, error) { 2379 objectMap := make(map[string]interface{}) 2380 if sdi.ID != nil { 2381 objectMap["id"] = sdi.ID 2382 } 2383 if sdi.SecretID != nil { 2384 objectMap["sid"] = sdi.SecretID 2385 } 2386 if sdi.Attributes != nil { 2387 objectMap["attributes"] = sdi.Attributes 2388 } 2389 if sdi.Tags != nil { 2390 objectMap["tags"] = sdi.Tags 2391 } 2392 return json.Marshal(objectMap) 2393} 2394 2395// SasDefinitionListResult the storage account SAS definition list result. 2396type SasDefinitionListResult struct { 2397 autorest.Response `json:"-"` 2398 // Value - A response message containing a list of SAS definitions along with a link to the next page of SAS definitions. 2399 Value *[]SasDefinitionItem `json:"value,omitempty"` 2400 // NextLink - The URL to get the next set of SAS defintions. 2401 NextLink *string `json:"nextLink,omitempty"` 2402} 2403 2404// SasDefinitionListResultIterator provides access to a complete listing of SasDefinitionItem values. 2405type SasDefinitionListResultIterator struct { 2406 i int 2407 page SasDefinitionListResultPage 2408} 2409 2410// Next advances to the next value. If there was an error making 2411// the request the iterator does not advance and the error is returned. 2412func (iter *SasDefinitionListResultIterator) Next() error { 2413 iter.i++ 2414 if iter.i < len(iter.page.Values()) { 2415 return nil 2416 } 2417 err := iter.page.Next() 2418 if err != nil { 2419 iter.i-- 2420 return err 2421 } 2422 iter.i = 0 2423 return nil 2424} 2425 2426// NotDone returns true if the enumeration should be started or is not yet complete. 2427func (iter SasDefinitionListResultIterator) NotDone() bool { 2428 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2429} 2430 2431// Response returns the raw server response from the last page request. 2432func (iter SasDefinitionListResultIterator) Response() SasDefinitionListResult { 2433 return iter.page.Response() 2434} 2435 2436// Value returns the current value or a zero-initialized value if the 2437// iterator has advanced beyond the end of the collection. 2438func (iter SasDefinitionListResultIterator) Value() SasDefinitionItem { 2439 if !iter.page.NotDone() { 2440 return SasDefinitionItem{} 2441 } 2442 return iter.page.Values()[iter.i] 2443} 2444 2445// IsEmpty returns true if the ListResult contains no values. 2446func (sdlr SasDefinitionListResult) IsEmpty() bool { 2447 return sdlr.Value == nil || len(*sdlr.Value) == 0 2448} 2449 2450// sasDefinitionListResultPreparer prepares a request to retrieve the next set of results. 2451// It returns nil if no more results exist. 2452func (sdlr SasDefinitionListResult) sasDefinitionListResultPreparer() (*http.Request, error) { 2453 if sdlr.NextLink == nil || len(to.String(sdlr.NextLink)) < 1 { 2454 return nil, nil 2455 } 2456 return autorest.Prepare(&http.Request{}, 2457 autorest.AsJSON(), 2458 autorest.AsGet(), 2459 autorest.WithBaseURL(to.String(sdlr.NextLink))) 2460} 2461 2462// SasDefinitionListResultPage contains a page of SasDefinitionItem values. 2463type SasDefinitionListResultPage struct { 2464 fn func(SasDefinitionListResult) (SasDefinitionListResult, error) 2465 sdlr SasDefinitionListResult 2466} 2467 2468// Next advances to the next page of values. If there was an error making 2469// the request the page does not advance and the error is returned. 2470func (page *SasDefinitionListResultPage) Next() error { 2471 next, err := page.fn(page.sdlr) 2472 if err != nil { 2473 return err 2474 } 2475 page.sdlr = next 2476 return nil 2477} 2478 2479// NotDone returns true if the page enumeration should be started or is not yet complete. 2480func (page SasDefinitionListResultPage) NotDone() bool { 2481 return !page.sdlr.IsEmpty() 2482} 2483 2484// Response returns the raw server response from the last page request. 2485func (page SasDefinitionListResultPage) Response() SasDefinitionListResult { 2486 return page.sdlr 2487} 2488 2489// Values returns the slice of values for the current page or nil if there are no values. 2490func (page SasDefinitionListResultPage) Values() []SasDefinitionItem { 2491 if page.sdlr.IsEmpty() { 2492 return nil 2493 } 2494 return *page.sdlr.Value 2495} 2496 2497// SasDefinitionUpdateParameters the SAS definition update parameters. 2498type SasDefinitionUpdateParameters struct { 2499 // TemplateURI - The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. 2500 TemplateURI *string `json:"templateUri,omitempty"` 2501 // SasType - The type of SAS token the SAS definition will create. Possible values include: 'Account', 'Service' 2502 SasType SasTokenType `json:"sasType,omitempty"` 2503 // ValidityPeriod - The validity period of SAS tokens created according to the SAS definition. 2504 ValidityPeriod *string `json:"validityPeriod,omitempty"` 2505 // SasDefinitionAttributes - The attributes of the SAS definition. 2506 SasDefinitionAttributes *SasDefinitionAttributes `json:"attributes,omitempty"` 2507 // Tags - Application specific metadata in the form of key-value pairs. 2508 Tags map[string]*string `json:"tags"` 2509} 2510 2511// MarshalJSON is the custom marshaler for SasDefinitionUpdateParameters. 2512func (sdup SasDefinitionUpdateParameters) MarshalJSON() ([]byte, error) { 2513 objectMap := make(map[string]interface{}) 2514 if sdup.TemplateURI != nil { 2515 objectMap["templateUri"] = sdup.TemplateURI 2516 } 2517 if sdup.SasType != "" { 2518 objectMap["sasType"] = sdup.SasType 2519 } 2520 if sdup.ValidityPeriod != nil { 2521 objectMap["validityPeriod"] = sdup.ValidityPeriod 2522 } 2523 if sdup.SasDefinitionAttributes != nil { 2524 objectMap["attributes"] = sdup.SasDefinitionAttributes 2525 } 2526 if sdup.Tags != nil { 2527 objectMap["tags"] = sdup.Tags 2528 } 2529 return json.Marshal(objectMap) 2530} 2531 2532// SecretAttributes the secret management attributes. 2533type SecretAttributes struct { 2534 // RecoveryLevel - Reflects the deletion recovery level currently in effect for secrets in the current vault. If it contains 'Purgeable', the secret can be permanently deleted by a privileged user; otherwise, only the system can purge the secret, at the end of the retention interval. Possible values include: 'Purgeable', 'RecoverablePurgeable', 'Recoverable', 'RecoverableProtectedSubscription' 2535 RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` 2536 // Enabled - Determines whether the object is enabled. 2537 Enabled *bool `json:"enabled,omitempty"` 2538 // NotBefore - Not before date in UTC. 2539 NotBefore *date.UnixTime `json:"nbf,omitempty"` 2540 // Expires - Expiry date in UTC. 2541 Expires *date.UnixTime `json:"exp,omitempty"` 2542 // Created - Creation time in UTC. 2543 Created *date.UnixTime `json:"created,omitempty"` 2544 // Updated - Last updated time in UTC. 2545 Updated *date.UnixTime `json:"updated,omitempty"` 2546} 2547 2548// SecretBundle a secret consisting of a value, id and its attributes. 2549type SecretBundle struct { 2550 autorest.Response `json:"-"` 2551 // Value - The secret value. 2552 Value *string `json:"value,omitempty"` 2553 // ID - The secret id. 2554 ID *string `json:"id,omitempty"` 2555 // ContentType - The content type of the secret. 2556 ContentType *string `json:"contentType,omitempty"` 2557 // Attributes - The secret management attributes. 2558 Attributes *SecretAttributes `json:"attributes,omitempty"` 2559 // Tags - Application specific metadata in the form of key-value pairs. 2560 Tags map[string]*string `json:"tags"` 2561 // Kid - If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate. 2562 Kid *string `json:"kid,omitempty"` 2563 // Managed - True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be true. 2564 Managed *bool `json:"managed,omitempty"` 2565} 2566 2567// MarshalJSON is the custom marshaler for SecretBundle. 2568func (sb SecretBundle) MarshalJSON() ([]byte, error) { 2569 objectMap := make(map[string]interface{}) 2570 if sb.Value != nil { 2571 objectMap["value"] = sb.Value 2572 } 2573 if sb.ID != nil { 2574 objectMap["id"] = sb.ID 2575 } 2576 if sb.ContentType != nil { 2577 objectMap["contentType"] = sb.ContentType 2578 } 2579 if sb.Attributes != nil { 2580 objectMap["attributes"] = sb.Attributes 2581 } 2582 if sb.Tags != nil { 2583 objectMap["tags"] = sb.Tags 2584 } 2585 if sb.Kid != nil { 2586 objectMap["kid"] = sb.Kid 2587 } 2588 if sb.Managed != nil { 2589 objectMap["managed"] = sb.Managed 2590 } 2591 return json.Marshal(objectMap) 2592} 2593 2594// SecretItem the secret item containing secret metadata. 2595type SecretItem struct { 2596 // ID - Secret identifier. 2597 ID *string `json:"id,omitempty"` 2598 // Attributes - The secret management attributes. 2599 Attributes *SecretAttributes `json:"attributes,omitempty"` 2600 // Tags - Application specific metadata in the form of key-value pairs. 2601 Tags map[string]*string `json:"tags"` 2602 // ContentType - Type of the secret value such as a password. 2603 ContentType *string `json:"contentType,omitempty"` 2604 // Managed - True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. 2605 Managed *bool `json:"managed,omitempty"` 2606} 2607 2608// MarshalJSON is the custom marshaler for SecretItem. 2609func (si SecretItem) MarshalJSON() ([]byte, error) { 2610 objectMap := make(map[string]interface{}) 2611 if si.ID != nil { 2612 objectMap["id"] = si.ID 2613 } 2614 if si.Attributes != nil { 2615 objectMap["attributes"] = si.Attributes 2616 } 2617 if si.Tags != nil { 2618 objectMap["tags"] = si.Tags 2619 } 2620 if si.ContentType != nil { 2621 objectMap["contentType"] = si.ContentType 2622 } 2623 if si.Managed != nil { 2624 objectMap["managed"] = si.Managed 2625 } 2626 return json.Marshal(objectMap) 2627} 2628 2629// SecretListResult the secret list result. 2630type SecretListResult struct { 2631 autorest.Response `json:"-"` 2632 // Value - A response message containing a list of secrets in the key vault along with a link to the next page of secrets. 2633 Value *[]SecretItem `json:"value,omitempty"` 2634 // NextLink - The URL to get the next set of secrets. 2635 NextLink *string `json:"nextLink,omitempty"` 2636} 2637 2638// SecretListResultIterator provides access to a complete listing of SecretItem values. 2639type SecretListResultIterator struct { 2640 i int 2641 page SecretListResultPage 2642} 2643 2644// Next advances to the next value. If there was an error making 2645// the request the iterator does not advance and the error is returned. 2646func (iter *SecretListResultIterator) Next() error { 2647 iter.i++ 2648 if iter.i < len(iter.page.Values()) { 2649 return nil 2650 } 2651 err := iter.page.Next() 2652 if err != nil { 2653 iter.i-- 2654 return err 2655 } 2656 iter.i = 0 2657 return nil 2658} 2659 2660// NotDone returns true if the enumeration should be started or is not yet complete. 2661func (iter SecretListResultIterator) NotDone() bool { 2662 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2663} 2664 2665// Response returns the raw server response from the last page request. 2666func (iter SecretListResultIterator) Response() SecretListResult { 2667 return iter.page.Response() 2668} 2669 2670// Value returns the current value or a zero-initialized value if the 2671// iterator has advanced beyond the end of the collection. 2672func (iter SecretListResultIterator) Value() SecretItem { 2673 if !iter.page.NotDone() { 2674 return SecretItem{} 2675 } 2676 return iter.page.Values()[iter.i] 2677} 2678 2679// IsEmpty returns true if the ListResult contains no values. 2680func (slr SecretListResult) IsEmpty() bool { 2681 return slr.Value == nil || len(*slr.Value) == 0 2682} 2683 2684// secretListResultPreparer prepares a request to retrieve the next set of results. 2685// It returns nil if no more results exist. 2686func (slr SecretListResult) secretListResultPreparer() (*http.Request, error) { 2687 if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { 2688 return nil, nil 2689 } 2690 return autorest.Prepare(&http.Request{}, 2691 autorest.AsJSON(), 2692 autorest.AsGet(), 2693 autorest.WithBaseURL(to.String(slr.NextLink))) 2694} 2695 2696// SecretListResultPage contains a page of SecretItem values. 2697type SecretListResultPage struct { 2698 fn func(SecretListResult) (SecretListResult, error) 2699 slr SecretListResult 2700} 2701 2702// Next advances to the next page of values. If there was an error making 2703// the request the page does not advance and the error is returned. 2704func (page *SecretListResultPage) Next() error { 2705 next, err := page.fn(page.slr) 2706 if err != nil { 2707 return err 2708 } 2709 page.slr = next 2710 return nil 2711} 2712 2713// NotDone returns true if the page enumeration should be started or is not yet complete. 2714func (page SecretListResultPage) NotDone() bool { 2715 return !page.slr.IsEmpty() 2716} 2717 2718// Response returns the raw server response from the last page request. 2719func (page SecretListResultPage) Response() SecretListResult { 2720 return page.slr 2721} 2722 2723// Values returns the slice of values for the current page or nil if there are no values. 2724func (page SecretListResultPage) Values() []SecretItem { 2725 if page.slr.IsEmpty() { 2726 return nil 2727 } 2728 return *page.slr.Value 2729} 2730 2731// SecretProperties properties of the key backing a certificate. 2732type SecretProperties struct { 2733 // ContentType - The media type (MIME type). 2734 ContentType *string `json:"contentType,omitempty"` 2735} 2736 2737// SecretRestoreParameters the secret restore parameters. 2738type SecretRestoreParameters struct { 2739 // SecretBundleBackup - The backup blob associated with a secret bundle. 2740 SecretBundleBackup *string `json:"value,omitempty"` 2741} 2742 2743// SecretSetParameters the secret set parameters. 2744type SecretSetParameters struct { 2745 // Value - The value of the secret. 2746 Value *string `json:"value,omitempty"` 2747 // Tags - Application specific metadata in the form of key-value pairs. 2748 Tags map[string]*string `json:"tags"` 2749 // ContentType - Type of the secret value such as a password. 2750 ContentType *string `json:"contentType,omitempty"` 2751 // SecretAttributes - The secret management attributes. 2752 SecretAttributes *SecretAttributes `json:"attributes,omitempty"` 2753} 2754 2755// MarshalJSON is the custom marshaler for SecretSetParameters. 2756func (ssp SecretSetParameters) MarshalJSON() ([]byte, error) { 2757 objectMap := make(map[string]interface{}) 2758 if ssp.Value != nil { 2759 objectMap["value"] = ssp.Value 2760 } 2761 if ssp.Tags != nil { 2762 objectMap["tags"] = ssp.Tags 2763 } 2764 if ssp.ContentType != nil { 2765 objectMap["contentType"] = ssp.ContentType 2766 } 2767 if ssp.SecretAttributes != nil { 2768 objectMap["attributes"] = ssp.SecretAttributes 2769 } 2770 return json.Marshal(objectMap) 2771} 2772 2773// SecretUpdateParameters the secret update parameters. 2774type SecretUpdateParameters struct { 2775 // ContentType - Type of the secret value such as a password. 2776 ContentType *string `json:"contentType,omitempty"` 2777 // SecretAttributes - The secret management attributes. 2778 SecretAttributes *SecretAttributes `json:"attributes,omitempty"` 2779 // Tags - Application specific metadata in the form of key-value pairs. 2780 Tags map[string]*string `json:"tags"` 2781} 2782 2783// MarshalJSON is the custom marshaler for SecretUpdateParameters. 2784func (sup SecretUpdateParameters) MarshalJSON() ([]byte, error) { 2785 objectMap := make(map[string]interface{}) 2786 if sup.ContentType != nil { 2787 objectMap["contentType"] = sup.ContentType 2788 } 2789 if sup.SecretAttributes != nil { 2790 objectMap["attributes"] = sup.SecretAttributes 2791 } 2792 if sup.Tags != nil { 2793 objectMap["tags"] = sup.Tags 2794 } 2795 return json.Marshal(objectMap) 2796} 2797 2798// StorageAccountAttributes the storage account management attributes. 2799type StorageAccountAttributes struct { 2800 // Enabled - the enabled state of the object. 2801 Enabled *bool `json:"enabled,omitempty"` 2802 // Created - Creation time in UTC. 2803 Created *date.UnixTime `json:"created,omitempty"` 2804 // Updated - Last updated time in UTC. 2805 Updated *date.UnixTime `json:"updated,omitempty"` 2806 // RecoveryLevel - Reflects the deletion recovery level currently in effect for storage accounts in the current vault. If it contains 'Purgeable' the storage account can be permanently deleted by a privileged user; otherwise, only the system can purge the storage account, at the end of the retention interval. Possible values include: 'Purgeable', 'RecoverablePurgeable', 'Recoverable', 'RecoverableProtectedSubscription' 2807 RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` 2808} 2809 2810// StorageAccountCreateParameters the storage account create parameters. 2811type StorageAccountCreateParameters struct { 2812 // ResourceID - Storage account resource id. 2813 ResourceID *string `json:"resourceId,omitempty"` 2814 // ActiveKeyName - Current active storage account key name. 2815 ActiveKeyName *string `json:"activeKeyName,omitempty"` 2816 // AutoRegenerateKey - whether keyvault should manage the storage account for the user. 2817 AutoRegenerateKey *bool `json:"autoRegenerateKey,omitempty"` 2818 // RegenerationPeriod - The key regeneration time duration specified in ISO-8601 format. 2819 RegenerationPeriod *string `json:"regenerationPeriod,omitempty"` 2820 // StorageAccountAttributes - The attributes of the storage account. 2821 StorageAccountAttributes *StorageAccountAttributes `json:"attributes,omitempty"` 2822 // Tags - Application specific metadata in the form of key-value pairs. 2823 Tags map[string]*string `json:"tags"` 2824} 2825 2826// MarshalJSON is the custom marshaler for StorageAccountCreateParameters. 2827func (sacp StorageAccountCreateParameters) MarshalJSON() ([]byte, error) { 2828 objectMap := make(map[string]interface{}) 2829 if sacp.ResourceID != nil { 2830 objectMap["resourceId"] = sacp.ResourceID 2831 } 2832 if sacp.ActiveKeyName != nil { 2833 objectMap["activeKeyName"] = sacp.ActiveKeyName 2834 } 2835 if sacp.AutoRegenerateKey != nil { 2836 objectMap["autoRegenerateKey"] = sacp.AutoRegenerateKey 2837 } 2838 if sacp.RegenerationPeriod != nil { 2839 objectMap["regenerationPeriod"] = sacp.RegenerationPeriod 2840 } 2841 if sacp.StorageAccountAttributes != nil { 2842 objectMap["attributes"] = sacp.StorageAccountAttributes 2843 } 2844 if sacp.Tags != nil { 2845 objectMap["tags"] = sacp.Tags 2846 } 2847 return json.Marshal(objectMap) 2848} 2849 2850// StorageAccountItem the storage account item containing storage account metadata. 2851type StorageAccountItem struct { 2852 // ID - Storage identifier. 2853 ID *string `json:"id,omitempty"` 2854 // ResourceID - Storage account resource Id. 2855 ResourceID *string `json:"resourceId,omitempty"` 2856 // Attributes - The storage account management attributes. 2857 Attributes *StorageAccountAttributes `json:"attributes,omitempty"` 2858 // Tags - Application specific metadata in the form of key-value pairs. 2859 Tags map[string]*string `json:"tags"` 2860} 2861 2862// MarshalJSON is the custom marshaler for StorageAccountItem. 2863func (sai StorageAccountItem) MarshalJSON() ([]byte, error) { 2864 objectMap := make(map[string]interface{}) 2865 if sai.ID != nil { 2866 objectMap["id"] = sai.ID 2867 } 2868 if sai.ResourceID != nil { 2869 objectMap["resourceId"] = sai.ResourceID 2870 } 2871 if sai.Attributes != nil { 2872 objectMap["attributes"] = sai.Attributes 2873 } 2874 if sai.Tags != nil { 2875 objectMap["tags"] = sai.Tags 2876 } 2877 return json.Marshal(objectMap) 2878} 2879 2880// StorageAccountRegenerteKeyParameters the storage account key regenerate parameters. 2881type StorageAccountRegenerteKeyParameters struct { 2882 // KeyName - The storage account key name. 2883 KeyName *string `json:"keyName,omitempty"` 2884} 2885 2886// StorageAccountUpdateParameters the storage account update parameters. 2887type StorageAccountUpdateParameters struct { 2888 // ActiveKeyName - The current active storage account key name. 2889 ActiveKeyName *string `json:"activeKeyName,omitempty"` 2890 // AutoRegenerateKey - whether keyvault should manage the storage account for the user. 2891 AutoRegenerateKey *bool `json:"autoRegenerateKey,omitempty"` 2892 // RegenerationPeriod - The key regeneration time duration specified in ISO-8601 format. 2893 RegenerationPeriod *string `json:"regenerationPeriod,omitempty"` 2894 // StorageAccountAttributes - The attributes of the storage account. 2895 StorageAccountAttributes *StorageAccountAttributes `json:"attributes,omitempty"` 2896 // Tags - Application specific metadata in the form of key-value pairs. 2897 Tags map[string]*string `json:"tags"` 2898} 2899 2900// MarshalJSON is the custom marshaler for StorageAccountUpdateParameters. 2901func (saup StorageAccountUpdateParameters) MarshalJSON() ([]byte, error) { 2902 objectMap := make(map[string]interface{}) 2903 if saup.ActiveKeyName != nil { 2904 objectMap["activeKeyName"] = saup.ActiveKeyName 2905 } 2906 if saup.AutoRegenerateKey != nil { 2907 objectMap["autoRegenerateKey"] = saup.AutoRegenerateKey 2908 } 2909 if saup.RegenerationPeriod != nil { 2910 objectMap["regenerationPeriod"] = saup.RegenerationPeriod 2911 } 2912 if saup.StorageAccountAttributes != nil { 2913 objectMap["attributes"] = saup.StorageAccountAttributes 2914 } 2915 if saup.Tags != nil { 2916 objectMap["tags"] = saup.Tags 2917 } 2918 return json.Marshal(objectMap) 2919} 2920 2921// StorageBundle a Storage account bundle consists of key vault storage account details plus its attributes. 2922type StorageBundle struct { 2923 autorest.Response `json:"-"` 2924 // ID - The storage account id. 2925 ID *string `json:"id,omitempty"` 2926 // ResourceID - The storage account resource id. 2927 ResourceID *string `json:"resourceId,omitempty"` 2928 // ActiveKeyName - The current active storage account key name. 2929 ActiveKeyName *string `json:"activeKeyName,omitempty"` 2930 // AutoRegenerateKey - whether keyvault should manage the storage account for the user. 2931 AutoRegenerateKey *bool `json:"autoRegenerateKey,omitempty"` 2932 // RegenerationPeriod - The key regeneration time duration specified in ISO-8601 format. 2933 RegenerationPeriod *string `json:"regenerationPeriod,omitempty"` 2934 // Attributes - The storage account attributes. 2935 Attributes *StorageAccountAttributes `json:"attributes,omitempty"` 2936 // Tags - Application specific metadata in the form of key-value pairs 2937 Tags map[string]*string `json:"tags"` 2938} 2939 2940// MarshalJSON is the custom marshaler for StorageBundle. 2941func (sb StorageBundle) MarshalJSON() ([]byte, error) { 2942 objectMap := make(map[string]interface{}) 2943 if sb.ID != nil { 2944 objectMap["id"] = sb.ID 2945 } 2946 if sb.ResourceID != nil { 2947 objectMap["resourceId"] = sb.ResourceID 2948 } 2949 if sb.ActiveKeyName != nil { 2950 objectMap["activeKeyName"] = sb.ActiveKeyName 2951 } 2952 if sb.AutoRegenerateKey != nil { 2953 objectMap["autoRegenerateKey"] = sb.AutoRegenerateKey 2954 } 2955 if sb.RegenerationPeriod != nil { 2956 objectMap["regenerationPeriod"] = sb.RegenerationPeriod 2957 } 2958 if sb.Attributes != nil { 2959 objectMap["attributes"] = sb.Attributes 2960 } 2961 if sb.Tags != nil { 2962 objectMap["tags"] = sb.Tags 2963 } 2964 return json.Marshal(objectMap) 2965} 2966 2967// StorageListResult the storage accounts list result. 2968type StorageListResult struct { 2969 autorest.Response `json:"-"` 2970 // Value - A response message containing a list of storage accounts in the key vault along with a link to the next page of storage accounts. 2971 Value *[]StorageAccountItem `json:"value,omitempty"` 2972 // NextLink - The URL to get the next set of storage accounts. 2973 NextLink *string `json:"nextLink,omitempty"` 2974} 2975 2976// StorageListResultIterator provides access to a complete listing of StorageAccountItem values. 2977type StorageListResultIterator struct { 2978 i int 2979 page StorageListResultPage 2980} 2981 2982// Next advances to the next value. If there was an error making 2983// the request the iterator does not advance and the error is returned. 2984func (iter *StorageListResultIterator) Next() error { 2985 iter.i++ 2986 if iter.i < len(iter.page.Values()) { 2987 return nil 2988 } 2989 err := iter.page.Next() 2990 if err != nil { 2991 iter.i-- 2992 return err 2993 } 2994 iter.i = 0 2995 return nil 2996} 2997 2998// NotDone returns true if the enumeration should be started or is not yet complete. 2999func (iter StorageListResultIterator) NotDone() bool { 3000 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3001} 3002 3003// Response returns the raw server response from the last page request. 3004func (iter StorageListResultIterator) Response() StorageListResult { 3005 return iter.page.Response() 3006} 3007 3008// Value returns the current value or a zero-initialized value if the 3009// iterator has advanced beyond the end of the collection. 3010func (iter StorageListResultIterator) Value() StorageAccountItem { 3011 if !iter.page.NotDone() { 3012 return StorageAccountItem{} 3013 } 3014 return iter.page.Values()[iter.i] 3015} 3016 3017// IsEmpty returns true if the ListResult contains no values. 3018func (slr StorageListResult) IsEmpty() bool { 3019 return slr.Value == nil || len(*slr.Value) == 0 3020} 3021 3022// storageListResultPreparer prepares a request to retrieve the next set of results. 3023// It returns nil if no more results exist. 3024func (slr StorageListResult) storageListResultPreparer() (*http.Request, error) { 3025 if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { 3026 return nil, nil 3027 } 3028 return autorest.Prepare(&http.Request{}, 3029 autorest.AsJSON(), 3030 autorest.AsGet(), 3031 autorest.WithBaseURL(to.String(slr.NextLink))) 3032} 3033 3034// StorageListResultPage contains a page of StorageAccountItem values. 3035type StorageListResultPage struct { 3036 fn func(StorageListResult) (StorageListResult, error) 3037 slr StorageListResult 3038} 3039 3040// Next advances to the next page of values. If there was an error making 3041// the request the page does not advance and the error is returned. 3042func (page *StorageListResultPage) Next() error { 3043 next, err := page.fn(page.slr) 3044 if err != nil { 3045 return err 3046 } 3047 page.slr = next 3048 return nil 3049} 3050 3051// NotDone returns true if the page enumeration should be started or is not yet complete. 3052func (page StorageListResultPage) NotDone() bool { 3053 return !page.slr.IsEmpty() 3054} 3055 3056// Response returns the raw server response from the last page request. 3057func (page StorageListResultPage) Response() StorageListResult { 3058 return page.slr 3059} 3060 3061// Values returns the slice of values for the current page or nil if there are no values. 3062func (page StorageListResultPage) Values() []StorageAccountItem { 3063 if page.slr.IsEmpty() { 3064 return nil 3065 } 3066 return *page.slr.Value 3067} 3068 3069// StorageRestoreParameters the secret restore parameters. 3070type StorageRestoreParameters struct { 3071 // StorageBundleBackup - The backup blob associated with a storage account. 3072 StorageBundleBackup *string `json:"value,omitempty"` 3073} 3074 3075// SubjectAlternativeNames the subject alternate names of a X509 object. 3076type SubjectAlternativeNames struct { 3077 // Emails - Email addresses. 3078 Emails *[]string `json:"emails,omitempty"` 3079 // DNSNames - Domain names. 3080 DNSNames *[]string `json:"dns_names,omitempty"` 3081 // Upns - User principal names. 3082 Upns *[]string `json:"upns,omitempty"` 3083} 3084 3085// Trigger a condition to be satisfied for an action to be executed. 3086type Trigger struct { 3087 // LifetimePercentage - Percentage of lifetime at which to trigger. Value should be between 1 and 99. 3088 LifetimePercentage *int32 `json:"lifetime_percentage,omitempty"` 3089 // DaysBeforeExpiry - Days before expiry to attempt renewal. Value should be between 1 and validity_in_months multiplied by 27. If validity_in_months is 36, then value should be between 1 and 972 (36 * 27). 3090 DaysBeforeExpiry *int32 `json:"days_before_expiry,omitempty"` 3091} 3092 3093// X509CertificateProperties properties of the X509 component of a certificate. 3094type X509CertificateProperties struct { 3095 // Subject - The subject name. Should be a valid X509 distinguished Name. 3096 Subject *string `json:"subject,omitempty"` 3097 // Ekus - The enhanced key usage. 3098 Ekus *[]string `json:"ekus,omitempty"` 3099 // SubjectAlternativeNames - The subject alternative names. 3100 SubjectAlternativeNames *SubjectAlternativeNames `json:"sans,omitempty"` 3101 // KeyUsage - List of key usages. 3102 KeyUsage *[]KeyUsageType `json:"key_usage,omitempty"` 3103 // ValidityInMonths - The duration that the ceritifcate is valid in months. 3104 ValidityInMonths *int32 `json:"validity_months,omitempty"` 3105} 3106