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