1package keyvault 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/azure" 14 "github.com/Azure/go-autorest/autorest/date" 15 "github.com/Azure/go-autorest/autorest/to" 16 "github.com/Azure/go-autorest/tracing" 17 "net/http" 18) 19 20// The package's fully qualified name. 21const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/keyvault/v7.2-preview/keyvault" 22 23// Action the action that will be executed. 24type Action struct { 25 // ActionType - The type of the action. Possible values include: 'EmailContacts', 'AutoRenew' 26 ActionType ActionType `json:"action_type,omitempty"` 27} 28 29// AdministratorDetails details of the organization administrator of the certificate issuer. 30type AdministratorDetails struct { 31 // FirstName - First name. 32 FirstName *string `json:"first_name,omitempty"` 33 // LastName - Last name. 34 LastName *string `json:"last_name,omitempty"` 35 // EmailAddress - Email address. 36 EmailAddress *string `json:"email,omitempty"` 37 // Phone - Phone number. 38 Phone *string `json:"phone,omitempty"` 39} 40 41// Attributes the object attributes managed by the KeyVault service. 42type Attributes struct { 43 // Enabled - Determines whether the object is enabled. 44 Enabled *bool `json:"enabled,omitempty"` 45 // NotBefore - Not before date in UTC. 46 NotBefore *date.UnixTime `json:"nbf,omitempty"` 47 // Expires - Expiry date in UTC. 48 Expires *date.UnixTime `json:"exp,omitempty"` 49 // Created - READ-ONLY; Creation time in UTC. 50 Created *date.UnixTime `json:"created,omitempty"` 51 // Updated - READ-ONLY; Last updated time in UTC. 52 Updated *date.UnixTime `json:"updated,omitempty"` 53} 54 55// MarshalJSON is the custom marshaler for Attributes. 56func (a Attributes) MarshalJSON() ([]byte, error) { 57 objectMap := make(map[string]interface{}) 58 if a.Enabled != nil { 59 objectMap["enabled"] = a.Enabled 60 } 61 if a.NotBefore != nil { 62 objectMap["nbf"] = a.NotBefore 63 } 64 if a.Expires != nil { 65 objectMap["exp"] = a.Expires 66 } 67 return json.Marshal(objectMap) 68} 69 70// BackupCertificateResult the backup certificate result, containing the backup blob. 71type BackupCertificateResult struct { 72 autorest.Response `json:"-"` 73 // Value - READ-ONLY; The backup blob containing the backed up certificate. (a URL-encoded base64 string) 74 Value *string `json:"value,omitempty"` 75} 76 77// MarshalJSON is the custom marshaler for BackupCertificateResult. 78func (bcr BackupCertificateResult) MarshalJSON() ([]byte, error) { 79 objectMap := make(map[string]interface{}) 80 return json.Marshal(objectMap) 81} 82 83// BackupKeyResult the backup key result, containing the backup blob. 84type BackupKeyResult struct { 85 autorest.Response `json:"-"` 86 // Value - READ-ONLY; The backup blob containing the backed up key. (a URL-encoded base64 string) 87 Value *string `json:"value,omitempty"` 88} 89 90// MarshalJSON is the custom marshaler for BackupKeyResult. 91func (bkr BackupKeyResult) MarshalJSON() ([]byte, error) { 92 objectMap := make(map[string]interface{}) 93 return json.Marshal(objectMap) 94} 95 96// BackupSecretResult the backup secret result, containing the backup blob. 97type BackupSecretResult struct { 98 autorest.Response `json:"-"` 99 // Value - READ-ONLY; The backup blob containing the backed up secret. (a URL-encoded base64 string) 100 Value *string `json:"value,omitempty"` 101} 102 103// MarshalJSON is the custom marshaler for BackupSecretResult. 104func (bsr BackupSecretResult) MarshalJSON() ([]byte, error) { 105 objectMap := make(map[string]interface{}) 106 return json.Marshal(objectMap) 107} 108 109// BackupStorageResult the backup storage result, containing the backup blob. 110type BackupStorageResult struct { 111 autorest.Response `json:"-"` 112 // Value - READ-ONLY; The backup blob containing the backed up storage account. (a URL-encoded base64 string) 113 Value *string `json:"value,omitempty"` 114} 115 116// MarshalJSON is the custom marshaler for BackupStorageResult. 117func (bsr BackupStorageResult) MarshalJSON() ([]byte, error) { 118 objectMap := make(map[string]interface{}) 119 return json.Marshal(objectMap) 120} 121 122// CertificateAttributes the certificate management attributes. 123type CertificateAttributes struct { 124 // RecoverableDays - READ-ONLY; softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0. 125 RecoverableDays *int32 `json:"recoverableDays,omitempty"` 126 // RecoveryLevel - READ-ONLY; 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', 'CustomizedRecoverablePurgeable', 'CustomizedRecoverable', 'CustomizedRecoverableProtectedSubscription' 127 RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` 128 // Enabled - Determines whether the object is enabled. 129 Enabled *bool `json:"enabled,omitempty"` 130 // NotBefore - Not before date in UTC. 131 NotBefore *date.UnixTime `json:"nbf,omitempty"` 132 // Expires - Expiry date in UTC. 133 Expires *date.UnixTime `json:"exp,omitempty"` 134 // Created - READ-ONLY; Creation time in UTC. 135 Created *date.UnixTime `json:"created,omitempty"` 136 // Updated - READ-ONLY; Last updated time in UTC. 137 Updated *date.UnixTime `json:"updated,omitempty"` 138} 139 140// MarshalJSON is the custom marshaler for CertificateAttributes. 141func (ca CertificateAttributes) MarshalJSON() ([]byte, error) { 142 objectMap := make(map[string]interface{}) 143 if ca.Enabled != nil { 144 objectMap["enabled"] = ca.Enabled 145 } 146 if ca.NotBefore != nil { 147 objectMap["nbf"] = ca.NotBefore 148 } 149 if ca.Expires != nil { 150 objectMap["exp"] = ca.Expires 151 } 152 return json.Marshal(objectMap) 153} 154 155// CertificateBundle a certificate bundle consists of a certificate (X509) plus its attributes. 156type CertificateBundle struct { 157 autorest.Response `json:"-"` 158 // ID - READ-ONLY; The certificate id. 159 ID *string `json:"id,omitempty"` 160 // Kid - READ-ONLY; The key id. 161 Kid *string `json:"kid,omitempty"` 162 // Sid - READ-ONLY; The secret id. 163 Sid *string `json:"sid,omitempty"` 164 // X509Thumbprint - READ-ONLY; Thumbprint of the certificate. (a URL-encoded base64 string) 165 X509Thumbprint *string `json:"x5t,omitempty"` 166 // Policy - READ-ONLY; The management policy. 167 Policy *CertificatePolicy `json:"policy,omitempty"` 168 // Cer - CER contents of x509 certificate. 169 Cer *[]byte `json:"cer,omitempty"` 170 // ContentType - The content type of the secret. 171 ContentType *string `json:"contentType,omitempty"` 172 // Attributes - The certificate attributes. 173 Attributes *CertificateAttributes `json:"attributes,omitempty"` 174 // Tags - Application specific metadata in the form of key-value pairs 175 Tags map[string]*string `json:"tags"` 176} 177 178// MarshalJSON is the custom marshaler for CertificateBundle. 179func (cb CertificateBundle) MarshalJSON() ([]byte, error) { 180 objectMap := make(map[string]interface{}) 181 if cb.Cer != nil { 182 objectMap["cer"] = cb.Cer 183 } 184 if cb.ContentType != nil { 185 objectMap["contentType"] = cb.ContentType 186 } 187 if cb.Attributes != nil { 188 objectMap["attributes"] = cb.Attributes 189 } 190 if cb.Tags != nil { 191 objectMap["tags"] = cb.Tags 192 } 193 return json.Marshal(objectMap) 194} 195 196// CertificateCreateParameters the certificate create parameters. 197type CertificateCreateParameters struct { 198 // CertificatePolicy - The management policy for the certificate. 199 CertificatePolicy *CertificatePolicy `json:"policy,omitempty"` 200 // CertificateAttributes - The attributes of the certificate (optional). 201 CertificateAttributes *CertificateAttributes `json:"attributes,omitempty"` 202 // Tags - Application specific metadata in the form of key-value pairs. 203 Tags map[string]*string `json:"tags"` 204} 205 206// MarshalJSON is the custom marshaler for CertificateCreateParameters. 207func (ccp CertificateCreateParameters) MarshalJSON() ([]byte, error) { 208 objectMap := make(map[string]interface{}) 209 if ccp.CertificatePolicy != nil { 210 objectMap["policy"] = ccp.CertificatePolicy 211 } 212 if ccp.CertificateAttributes != nil { 213 objectMap["attributes"] = ccp.CertificateAttributes 214 } 215 if ccp.Tags != nil { 216 objectMap["tags"] = ccp.Tags 217 } 218 return json.Marshal(objectMap) 219} 220 221// CertificateImportParameters the certificate import parameters. 222type CertificateImportParameters struct { 223 // Base64EncodedCertificate - Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. 224 Base64EncodedCertificate *string `json:"value,omitempty"` 225 // Password - If the private key in base64EncodedCertificate is encrypted, the password used for encryption. 226 Password *string `json:"pwd,omitempty"` 227 // CertificatePolicy - The management policy for the certificate. 228 CertificatePolicy *CertificatePolicy `json:"policy,omitempty"` 229 // CertificateAttributes - The attributes of the certificate (optional). 230 CertificateAttributes *CertificateAttributes `json:"attributes,omitempty"` 231 // Tags - Application specific metadata in the form of key-value pairs. 232 Tags map[string]*string `json:"tags"` 233} 234 235// MarshalJSON is the custom marshaler for CertificateImportParameters. 236func (cip CertificateImportParameters) MarshalJSON() ([]byte, error) { 237 objectMap := make(map[string]interface{}) 238 if cip.Base64EncodedCertificate != nil { 239 objectMap["value"] = cip.Base64EncodedCertificate 240 } 241 if cip.Password != nil { 242 objectMap["pwd"] = cip.Password 243 } 244 if cip.CertificatePolicy != nil { 245 objectMap["policy"] = cip.CertificatePolicy 246 } 247 if cip.CertificateAttributes != nil { 248 objectMap["attributes"] = cip.CertificateAttributes 249 } 250 if cip.Tags != nil { 251 objectMap["tags"] = cip.Tags 252 } 253 return json.Marshal(objectMap) 254} 255 256// CertificateInfoObject ... 257type CertificateInfoObject struct { 258 // Certificates - Certificates needed from customer 259 Certificates *[]SecurityDomainCertificateItem `json:"certificates,omitempty"` 260 // Required - Customer to specify the number of certificates (minimum 2 and maximum 10) to restore security domain 261 Required *int32 `json:"required,omitempty"` 262} 263 264// CertificateIssuerItem the certificate issuer item containing certificate issuer metadata. 265type CertificateIssuerItem struct { 266 // ID - Certificate Identifier. 267 ID *string `json:"id,omitempty"` 268 // Provider - The issuer provider. 269 Provider *string `json:"provider,omitempty"` 270} 271 272// CertificateIssuerListResult the certificate issuer list result. 273type CertificateIssuerListResult struct { 274 autorest.Response `json:"-"` 275 // Value - READ-ONLY; A response message containing a list of certificate issuers in the key vault along with a link to the next page of certificate issuers. 276 Value *[]CertificateIssuerItem `json:"value,omitempty"` 277 // NextLink - READ-ONLY; The URL to get the next set of certificate issuers. 278 NextLink *string `json:"nextLink,omitempty"` 279} 280 281// MarshalJSON is the custom marshaler for CertificateIssuerListResult. 282func (cilr CertificateIssuerListResult) MarshalJSON() ([]byte, error) { 283 objectMap := make(map[string]interface{}) 284 return json.Marshal(objectMap) 285} 286 287// CertificateIssuerListResultIterator provides access to a complete listing of CertificateIssuerItem 288// values. 289type CertificateIssuerListResultIterator struct { 290 i int 291 page CertificateIssuerListResultPage 292} 293 294// NextWithContext advances to the next value. If there was an error making 295// the request the iterator does not advance and the error is returned. 296func (iter *CertificateIssuerListResultIterator) NextWithContext(ctx context.Context) (err error) { 297 if tracing.IsEnabled() { 298 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateIssuerListResultIterator.NextWithContext") 299 defer func() { 300 sc := -1 301 if iter.Response().Response.Response != nil { 302 sc = iter.Response().Response.Response.StatusCode 303 } 304 tracing.EndSpan(ctx, sc, err) 305 }() 306 } 307 iter.i++ 308 if iter.i < len(iter.page.Values()) { 309 return nil 310 } 311 err = iter.page.NextWithContext(ctx) 312 if err != nil { 313 iter.i-- 314 return err 315 } 316 iter.i = 0 317 return nil 318} 319 320// Next advances to the next value. If there was an error making 321// the request the iterator does not advance and the error is returned. 322// Deprecated: Use NextWithContext() instead. 323func (iter *CertificateIssuerListResultIterator) Next() error { 324 return iter.NextWithContext(context.Background()) 325} 326 327// NotDone returns true if the enumeration should be started or is not yet complete. 328func (iter CertificateIssuerListResultIterator) NotDone() bool { 329 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 330} 331 332// Response returns the raw server response from the last page request. 333func (iter CertificateIssuerListResultIterator) Response() CertificateIssuerListResult { 334 return iter.page.Response() 335} 336 337// Value returns the current value or a zero-initialized value if the 338// iterator has advanced beyond the end of the collection. 339func (iter CertificateIssuerListResultIterator) Value() CertificateIssuerItem { 340 if !iter.page.NotDone() { 341 return CertificateIssuerItem{} 342 } 343 return iter.page.Values()[iter.i] 344} 345 346// Creates a new instance of the CertificateIssuerListResultIterator type. 347func NewCertificateIssuerListResultIterator(page CertificateIssuerListResultPage) CertificateIssuerListResultIterator { 348 return CertificateIssuerListResultIterator{page: page} 349} 350 351// IsEmpty returns true if the ListResult contains no values. 352func (cilr CertificateIssuerListResult) IsEmpty() bool { 353 return cilr.Value == nil || len(*cilr.Value) == 0 354} 355 356// hasNextLink returns true if the NextLink is not empty. 357func (cilr CertificateIssuerListResult) hasNextLink() bool { 358 return cilr.NextLink != nil && len(*cilr.NextLink) != 0 359} 360 361// certificateIssuerListResultPreparer prepares a request to retrieve the next set of results. 362// It returns nil if no more results exist. 363func (cilr CertificateIssuerListResult) certificateIssuerListResultPreparer(ctx context.Context) (*http.Request, error) { 364 if !cilr.hasNextLink() { 365 return nil, nil 366 } 367 return autorest.Prepare((&http.Request{}).WithContext(ctx), 368 autorest.AsJSON(), 369 autorest.AsGet(), 370 autorest.WithBaseURL(to.String(cilr.NextLink))) 371} 372 373// CertificateIssuerListResultPage contains a page of CertificateIssuerItem values. 374type CertificateIssuerListResultPage struct { 375 fn func(context.Context, CertificateIssuerListResult) (CertificateIssuerListResult, error) 376 cilr CertificateIssuerListResult 377} 378 379// NextWithContext advances to the next page of values. If there was an error making 380// the request the page does not advance and the error is returned. 381func (page *CertificateIssuerListResultPage) NextWithContext(ctx context.Context) (err error) { 382 if tracing.IsEnabled() { 383 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateIssuerListResultPage.NextWithContext") 384 defer func() { 385 sc := -1 386 if page.Response().Response.Response != nil { 387 sc = page.Response().Response.Response.StatusCode 388 } 389 tracing.EndSpan(ctx, sc, err) 390 }() 391 } 392 for { 393 next, err := page.fn(ctx, page.cilr) 394 if err != nil { 395 return err 396 } 397 page.cilr = next 398 if !next.hasNextLink() || !next.IsEmpty() { 399 break 400 } 401 } 402 return nil 403} 404 405// Next advances to the next page of values. If there was an error making 406// the request the page does not advance and the error is returned. 407// Deprecated: Use NextWithContext() instead. 408func (page *CertificateIssuerListResultPage) Next() error { 409 return page.NextWithContext(context.Background()) 410} 411 412// NotDone returns true if the page enumeration should be started or is not yet complete. 413func (page CertificateIssuerListResultPage) NotDone() bool { 414 return !page.cilr.IsEmpty() 415} 416 417// Response returns the raw server response from the last page request. 418func (page CertificateIssuerListResultPage) Response() CertificateIssuerListResult { 419 return page.cilr 420} 421 422// Values returns the slice of values for the current page or nil if there are no values. 423func (page CertificateIssuerListResultPage) Values() []CertificateIssuerItem { 424 if page.cilr.IsEmpty() { 425 return nil 426 } 427 return *page.cilr.Value 428} 429 430// Creates a new instance of the CertificateIssuerListResultPage type. 431func NewCertificateIssuerListResultPage(cur CertificateIssuerListResult, getNextPage func(context.Context, CertificateIssuerListResult) (CertificateIssuerListResult, error)) CertificateIssuerListResultPage { 432 return CertificateIssuerListResultPage{ 433 fn: getNextPage, 434 cilr: cur, 435 } 436} 437 438// CertificateIssuerSetParameters the certificate issuer set parameters. 439type CertificateIssuerSetParameters struct { 440 // Provider - The issuer provider. 441 Provider *string `json:"provider,omitempty"` 442 // Credentials - The credentials to be used for the issuer. 443 Credentials *IssuerCredentials `json:"credentials,omitempty"` 444 // OrganizationDetails - Details of the organization as provided to the issuer. 445 OrganizationDetails *OrganizationDetails `json:"org_details,omitempty"` 446 // Attributes - Attributes of the issuer object. 447 Attributes *IssuerAttributes `json:"attributes,omitempty"` 448} 449 450// CertificateIssuerUpdateParameters the certificate issuer update parameters. 451type CertificateIssuerUpdateParameters struct { 452 // Provider - The issuer provider. 453 Provider *string `json:"provider,omitempty"` 454 // Credentials - The credentials to be used for the issuer. 455 Credentials *IssuerCredentials `json:"credentials,omitempty"` 456 // OrganizationDetails - Details of the organization as provided to the issuer. 457 OrganizationDetails *OrganizationDetails `json:"org_details,omitempty"` 458 // Attributes - Attributes of the issuer object. 459 Attributes *IssuerAttributes `json:"attributes,omitempty"` 460} 461 462// CertificateItem the certificate item containing certificate metadata. 463type CertificateItem struct { 464 // ID - Certificate identifier. 465 ID *string `json:"id,omitempty"` 466 // Attributes - The certificate management attributes. 467 Attributes *CertificateAttributes `json:"attributes,omitempty"` 468 // Tags - Application specific metadata in the form of key-value pairs. 469 Tags map[string]*string `json:"tags"` 470 // X509Thumbprint - Thumbprint of the certificate. (a URL-encoded base64 string) 471 X509Thumbprint *string `json:"x5t,omitempty"` 472} 473 474// MarshalJSON is the custom marshaler for CertificateItem. 475func (ci CertificateItem) MarshalJSON() ([]byte, error) { 476 objectMap := make(map[string]interface{}) 477 if ci.ID != nil { 478 objectMap["id"] = ci.ID 479 } 480 if ci.Attributes != nil { 481 objectMap["attributes"] = ci.Attributes 482 } 483 if ci.Tags != nil { 484 objectMap["tags"] = ci.Tags 485 } 486 if ci.X509Thumbprint != nil { 487 objectMap["x5t"] = ci.X509Thumbprint 488 } 489 return json.Marshal(objectMap) 490} 491 492// CertificateListResult the certificate list result. 493type CertificateListResult struct { 494 autorest.Response `json:"-"` 495 // Value - READ-ONLY; A response message containing a list of certificates in the key vault along with a link to the next page of certificates. 496 Value *[]CertificateItem `json:"value,omitempty"` 497 // NextLink - READ-ONLY; The URL to get the next set of certificates. 498 NextLink *string `json:"nextLink,omitempty"` 499} 500 501// MarshalJSON is the custom marshaler for CertificateListResult. 502func (clr CertificateListResult) MarshalJSON() ([]byte, error) { 503 objectMap := make(map[string]interface{}) 504 return json.Marshal(objectMap) 505} 506 507// CertificateListResultIterator provides access to a complete listing of CertificateItem values. 508type CertificateListResultIterator struct { 509 i int 510 page CertificateListResultPage 511} 512 513// NextWithContext advances to the next value. If there was an error making 514// the request the iterator does not advance and the error is returned. 515func (iter *CertificateListResultIterator) NextWithContext(ctx context.Context) (err error) { 516 if tracing.IsEnabled() { 517 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateListResultIterator.NextWithContext") 518 defer func() { 519 sc := -1 520 if iter.Response().Response.Response != nil { 521 sc = iter.Response().Response.Response.StatusCode 522 } 523 tracing.EndSpan(ctx, sc, err) 524 }() 525 } 526 iter.i++ 527 if iter.i < len(iter.page.Values()) { 528 return nil 529 } 530 err = iter.page.NextWithContext(ctx) 531 if err != nil { 532 iter.i-- 533 return err 534 } 535 iter.i = 0 536 return nil 537} 538 539// Next advances to the next value. If there was an error making 540// the request the iterator does not advance and the error is returned. 541// Deprecated: Use NextWithContext() instead. 542func (iter *CertificateListResultIterator) Next() error { 543 return iter.NextWithContext(context.Background()) 544} 545 546// NotDone returns true if the enumeration should be started or is not yet complete. 547func (iter CertificateListResultIterator) NotDone() bool { 548 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 549} 550 551// Response returns the raw server response from the last page request. 552func (iter CertificateListResultIterator) Response() CertificateListResult { 553 return iter.page.Response() 554} 555 556// Value returns the current value or a zero-initialized value if the 557// iterator has advanced beyond the end of the collection. 558func (iter CertificateListResultIterator) Value() CertificateItem { 559 if !iter.page.NotDone() { 560 return CertificateItem{} 561 } 562 return iter.page.Values()[iter.i] 563} 564 565// Creates a new instance of the CertificateListResultIterator type. 566func NewCertificateListResultIterator(page CertificateListResultPage) CertificateListResultIterator { 567 return CertificateListResultIterator{page: page} 568} 569 570// IsEmpty returns true if the ListResult contains no values. 571func (clr CertificateListResult) IsEmpty() bool { 572 return clr.Value == nil || len(*clr.Value) == 0 573} 574 575// hasNextLink returns true if the NextLink is not empty. 576func (clr CertificateListResult) hasNextLink() bool { 577 return clr.NextLink != nil && len(*clr.NextLink) != 0 578} 579 580// certificateListResultPreparer prepares a request to retrieve the next set of results. 581// It returns nil if no more results exist. 582func (clr CertificateListResult) certificateListResultPreparer(ctx context.Context) (*http.Request, error) { 583 if !clr.hasNextLink() { 584 return nil, nil 585 } 586 return autorest.Prepare((&http.Request{}).WithContext(ctx), 587 autorest.AsJSON(), 588 autorest.AsGet(), 589 autorest.WithBaseURL(to.String(clr.NextLink))) 590} 591 592// CertificateListResultPage contains a page of CertificateItem values. 593type CertificateListResultPage struct { 594 fn func(context.Context, CertificateListResult) (CertificateListResult, error) 595 clr CertificateListResult 596} 597 598// NextWithContext advances to the next page of values. If there was an error making 599// the request the page does not advance and the error is returned. 600func (page *CertificateListResultPage) NextWithContext(ctx context.Context) (err error) { 601 if tracing.IsEnabled() { 602 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateListResultPage.NextWithContext") 603 defer func() { 604 sc := -1 605 if page.Response().Response.Response != nil { 606 sc = page.Response().Response.Response.StatusCode 607 } 608 tracing.EndSpan(ctx, sc, err) 609 }() 610 } 611 for { 612 next, err := page.fn(ctx, page.clr) 613 if err != nil { 614 return err 615 } 616 page.clr = next 617 if !next.hasNextLink() || !next.IsEmpty() { 618 break 619 } 620 } 621 return nil 622} 623 624// Next advances to the next page of values. If there was an error making 625// the request the page does not advance and the error is returned. 626// Deprecated: Use NextWithContext() instead. 627func (page *CertificateListResultPage) Next() error { 628 return page.NextWithContext(context.Background()) 629} 630 631// NotDone returns true if the page enumeration should be started or is not yet complete. 632func (page CertificateListResultPage) NotDone() bool { 633 return !page.clr.IsEmpty() 634} 635 636// Response returns the raw server response from the last page request. 637func (page CertificateListResultPage) Response() CertificateListResult { 638 return page.clr 639} 640 641// Values returns the slice of values for the current page or nil if there are no values. 642func (page CertificateListResultPage) Values() []CertificateItem { 643 if page.clr.IsEmpty() { 644 return nil 645 } 646 return *page.clr.Value 647} 648 649// Creates a new instance of the CertificateListResultPage type. 650func NewCertificateListResultPage(cur CertificateListResult, getNextPage func(context.Context, CertificateListResult) (CertificateListResult, error)) CertificateListResultPage { 651 return CertificateListResultPage{ 652 fn: getNextPage, 653 clr: cur, 654 } 655} 656 657// CertificateMergeParameters the certificate merge parameters 658type CertificateMergeParameters struct { 659 // X509Certificates - The certificate or the certificate chain to merge. 660 X509Certificates *[][]byte `json:"x5c,omitempty"` 661 // CertificateAttributes - The attributes of the certificate (optional). 662 CertificateAttributes *CertificateAttributes `json:"attributes,omitempty"` 663 // Tags - Application specific metadata in the form of key-value pairs. 664 Tags map[string]*string `json:"tags"` 665} 666 667// MarshalJSON is the custom marshaler for CertificateMergeParameters. 668func (cmp CertificateMergeParameters) MarshalJSON() ([]byte, error) { 669 objectMap := make(map[string]interface{}) 670 if cmp.X509Certificates != nil { 671 objectMap["x5c"] = cmp.X509Certificates 672 } 673 if cmp.CertificateAttributes != nil { 674 objectMap["attributes"] = cmp.CertificateAttributes 675 } 676 if cmp.Tags != nil { 677 objectMap["tags"] = cmp.Tags 678 } 679 return json.Marshal(objectMap) 680} 681 682// CertificateOperation a certificate operation is returned in case of asynchronous requests. 683type CertificateOperation struct { 684 autorest.Response `json:"-"` 685 // ID - READ-ONLY; The certificate id. 686 ID *string `json:"id,omitempty"` 687 // IssuerParameters - Parameters for the issuer of the X509 component of a certificate. 688 IssuerParameters *IssuerParameters `json:"issuer,omitempty"` 689 // Csr - The certificate signing request (CSR) that is being used in the certificate operation. 690 Csr *[]byte `json:"csr,omitempty"` 691 // CancellationRequested - Indicates if cancellation was requested on the certificate operation. 692 CancellationRequested *bool `json:"cancellation_requested,omitempty"` 693 // Status - Status of the certificate operation. 694 Status *string `json:"status,omitempty"` 695 // StatusDetails - The status details of the certificate operation. 696 StatusDetails *string `json:"status_details,omitempty"` 697 // Error - Error encountered, if any, during the certificate operation. 698 Error *Error `json:"error,omitempty"` 699 // Target - Location which contains the result of the certificate operation. 700 Target *string `json:"target,omitempty"` 701 // RequestID - Identifier for the certificate operation. 702 RequestID *string `json:"request_id,omitempty"` 703} 704 705// MarshalJSON is the custom marshaler for CertificateOperation. 706func (co CertificateOperation) MarshalJSON() ([]byte, error) { 707 objectMap := make(map[string]interface{}) 708 if co.IssuerParameters != nil { 709 objectMap["issuer"] = co.IssuerParameters 710 } 711 if co.Csr != nil { 712 objectMap["csr"] = co.Csr 713 } 714 if co.CancellationRequested != nil { 715 objectMap["cancellation_requested"] = co.CancellationRequested 716 } 717 if co.Status != nil { 718 objectMap["status"] = co.Status 719 } 720 if co.StatusDetails != nil { 721 objectMap["status_details"] = co.StatusDetails 722 } 723 if co.Error != nil { 724 objectMap["error"] = co.Error 725 } 726 if co.Target != nil { 727 objectMap["target"] = co.Target 728 } 729 if co.RequestID != nil { 730 objectMap["request_id"] = co.RequestID 731 } 732 return json.Marshal(objectMap) 733} 734 735// CertificateOperationUpdateParameter the certificate operation update parameters. 736type CertificateOperationUpdateParameter struct { 737 // CancellationRequested - Indicates if cancellation was requested on the certificate operation. 738 CancellationRequested *bool `json:"cancellation_requested,omitempty"` 739} 740 741// CertificatePolicy management policy for a certificate. 742type CertificatePolicy struct { 743 autorest.Response `json:"-"` 744 // ID - READ-ONLY; The certificate id. 745 ID *string `json:"id,omitempty"` 746 // KeyProperties - Properties of the key backing a certificate. 747 KeyProperties *KeyProperties `json:"key_props,omitempty"` 748 // SecretProperties - Properties of the secret backing a certificate. 749 SecretProperties *SecretProperties `json:"secret_props,omitempty"` 750 // X509CertificateProperties - Properties of the X509 component of a certificate. 751 X509CertificateProperties *X509CertificateProperties `json:"x509_props,omitempty"` 752 // LifetimeActions - Actions that will be performed by Key Vault over the lifetime of a certificate. 753 LifetimeActions *[]LifetimeAction `json:"lifetime_actions,omitempty"` 754 // IssuerParameters - Parameters for the issuer of the X509 component of a certificate. 755 IssuerParameters *IssuerParameters `json:"issuer,omitempty"` 756 // Attributes - The certificate attributes. 757 Attributes *CertificateAttributes `json:"attributes,omitempty"` 758} 759 760// MarshalJSON is the custom marshaler for CertificatePolicy. 761func (cp CertificatePolicy) MarshalJSON() ([]byte, error) { 762 objectMap := make(map[string]interface{}) 763 if cp.KeyProperties != nil { 764 objectMap["key_props"] = cp.KeyProperties 765 } 766 if cp.SecretProperties != nil { 767 objectMap["secret_props"] = cp.SecretProperties 768 } 769 if cp.X509CertificateProperties != nil { 770 objectMap["x509_props"] = cp.X509CertificateProperties 771 } 772 if cp.LifetimeActions != nil { 773 objectMap["lifetime_actions"] = cp.LifetimeActions 774 } 775 if cp.IssuerParameters != nil { 776 objectMap["issuer"] = cp.IssuerParameters 777 } 778 if cp.Attributes != nil { 779 objectMap["attributes"] = cp.Attributes 780 } 781 return json.Marshal(objectMap) 782} 783 784// CertificateRestoreParameters the certificate restore parameters. 785type CertificateRestoreParameters struct { 786 // CertificateBundleBackup - The backup blob associated with a certificate bundle. (a URL-encoded base64 string) 787 CertificateBundleBackup *string `json:"value,omitempty"` 788} 789 790// CertificateUpdateParameters the certificate update parameters. 791type CertificateUpdateParameters struct { 792 // CertificatePolicy - The management policy for the certificate. 793 CertificatePolicy *CertificatePolicy `json:"policy,omitempty"` 794 // CertificateAttributes - The attributes of the certificate (optional). 795 CertificateAttributes *CertificateAttributes `json:"attributes,omitempty"` 796 // Tags - Application specific metadata in the form of key-value pairs. 797 Tags map[string]*string `json:"tags"` 798} 799 800// MarshalJSON is the custom marshaler for CertificateUpdateParameters. 801func (cup CertificateUpdateParameters) MarshalJSON() ([]byte, error) { 802 objectMap := make(map[string]interface{}) 803 if cup.CertificatePolicy != nil { 804 objectMap["policy"] = cup.CertificatePolicy 805 } 806 if cup.CertificateAttributes != nil { 807 objectMap["attributes"] = cup.CertificateAttributes 808 } 809 if cup.Tags != nil { 810 objectMap["tags"] = cup.Tags 811 } 812 return json.Marshal(objectMap) 813} 814 815// Contact the contact information for the vault certificates. 816type Contact struct { 817 // EmailAddress - Email address. 818 EmailAddress *string `json:"email,omitempty"` 819 // Name - Name. 820 Name *string `json:"name,omitempty"` 821 // Phone - Phone number. 822 Phone *string `json:"phone,omitempty"` 823} 824 825// Contacts the contacts for the vault certificates. 826type Contacts struct { 827 autorest.Response `json:"-"` 828 // ID - READ-ONLY; Identifier for the contacts collection. 829 ID *string `json:"id,omitempty"` 830 // ContactList - The contact list for the vault certificates. 831 ContactList *[]Contact `json:"contacts,omitempty"` 832} 833 834// MarshalJSON is the custom marshaler for Contacts. 835func (c Contacts) MarshalJSON() ([]byte, error) { 836 objectMap := make(map[string]interface{}) 837 if c.ContactList != nil { 838 objectMap["contacts"] = c.ContactList 839 } 840 return json.Marshal(objectMap) 841} 842 843// DeletedCertificateBundle a Deleted Certificate consisting of its previous id, attributes and its tags, 844// as well as information on when it will be purged. 845type DeletedCertificateBundle struct { 846 autorest.Response `json:"-"` 847 // RecoveryID - The url of the recovery object, used to identify and recover the deleted certificate. 848 RecoveryID *string `json:"recoveryId,omitempty"` 849 // ScheduledPurgeDate - READ-ONLY; The time when the certificate is scheduled to be purged, in UTC 850 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 851 // DeletedDate - READ-ONLY; The time when the certificate was deleted, in UTC 852 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 853 // ID - READ-ONLY; The certificate id. 854 ID *string `json:"id,omitempty"` 855 // Kid - READ-ONLY; The key id. 856 Kid *string `json:"kid,omitempty"` 857 // Sid - READ-ONLY; The secret id. 858 Sid *string `json:"sid,omitempty"` 859 // X509Thumbprint - READ-ONLY; Thumbprint of the certificate. (a URL-encoded base64 string) 860 X509Thumbprint *string `json:"x5t,omitempty"` 861 // Policy - READ-ONLY; The management policy. 862 Policy *CertificatePolicy `json:"policy,omitempty"` 863 // Cer - CER contents of x509 certificate. 864 Cer *[]byte `json:"cer,omitempty"` 865 // ContentType - The content type of the secret. 866 ContentType *string `json:"contentType,omitempty"` 867 // Attributes - The certificate attributes. 868 Attributes *CertificateAttributes `json:"attributes,omitempty"` 869 // Tags - Application specific metadata in the form of key-value pairs 870 Tags map[string]*string `json:"tags"` 871} 872 873// MarshalJSON is the custom marshaler for DeletedCertificateBundle. 874func (dcb DeletedCertificateBundle) MarshalJSON() ([]byte, error) { 875 objectMap := make(map[string]interface{}) 876 if dcb.RecoveryID != nil { 877 objectMap["recoveryId"] = dcb.RecoveryID 878 } 879 if dcb.Cer != nil { 880 objectMap["cer"] = dcb.Cer 881 } 882 if dcb.ContentType != nil { 883 objectMap["contentType"] = dcb.ContentType 884 } 885 if dcb.Attributes != nil { 886 objectMap["attributes"] = dcb.Attributes 887 } 888 if dcb.Tags != nil { 889 objectMap["tags"] = dcb.Tags 890 } 891 return json.Marshal(objectMap) 892} 893 894// DeletedCertificateItem the deleted certificate item containing metadata about the deleted certificate. 895type DeletedCertificateItem struct { 896 // RecoveryID - The url of the recovery object, used to identify and recover the deleted certificate. 897 RecoveryID *string `json:"recoveryId,omitempty"` 898 // ScheduledPurgeDate - READ-ONLY; The time when the certificate is scheduled to be purged, in UTC 899 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 900 // DeletedDate - READ-ONLY; The time when the certificate was deleted, in UTC 901 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 902 // ID - Certificate identifier. 903 ID *string `json:"id,omitempty"` 904 // Attributes - The certificate management attributes. 905 Attributes *CertificateAttributes `json:"attributes,omitempty"` 906 // Tags - Application specific metadata in the form of key-value pairs. 907 Tags map[string]*string `json:"tags"` 908 // X509Thumbprint - Thumbprint of the certificate. (a URL-encoded base64 string) 909 X509Thumbprint *string `json:"x5t,omitempty"` 910} 911 912// MarshalJSON is the custom marshaler for DeletedCertificateItem. 913func (dci DeletedCertificateItem) MarshalJSON() ([]byte, error) { 914 objectMap := make(map[string]interface{}) 915 if dci.RecoveryID != nil { 916 objectMap["recoveryId"] = dci.RecoveryID 917 } 918 if dci.ID != nil { 919 objectMap["id"] = dci.ID 920 } 921 if dci.Attributes != nil { 922 objectMap["attributes"] = dci.Attributes 923 } 924 if dci.Tags != nil { 925 objectMap["tags"] = dci.Tags 926 } 927 if dci.X509Thumbprint != nil { 928 objectMap["x5t"] = dci.X509Thumbprint 929 } 930 return json.Marshal(objectMap) 931} 932 933// DeletedCertificateListResult a list of certificates that have been deleted in this vault. 934type DeletedCertificateListResult struct { 935 autorest.Response `json:"-"` 936 // Value - READ-ONLY; A response message containing a list of deleted certificates in the vault along with a link to the next page of deleted certificates 937 Value *[]DeletedCertificateItem `json:"value,omitempty"` 938 // NextLink - READ-ONLY; The URL to get the next set of deleted certificates. 939 NextLink *string `json:"nextLink,omitempty"` 940} 941 942// MarshalJSON is the custom marshaler for DeletedCertificateListResult. 943func (dclr DeletedCertificateListResult) MarshalJSON() ([]byte, error) { 944 objectMap := make(map[string]interface{}) 945 return json.Marshal(objectMap) 946} 947 948// DeletedCertificateListResultIterator provides access to a complete listing of DeletedCertificateItem 949// values. 950type DeletedCertificateListResultIterator struct { 951 i int 952 page DeletedCertificateListResultPage 953} 954 955// NextWithContext advances to the next value. If there was an error making 956// the request the iterator does not advance and the error is returned. 957func (iter *DeletedCertificateListResultIterator) NextWithContext(ctx context.Context) (err error) { 958 if tracing.IsEnabled() { 959 ctx = tracing.StartSpan(ctx, fqdn+"/DeletedCertificateListResultIterator.NextWithContext") 960 defer func() { 961 sc := -1 962 if iter.Response().Response.Response != nil { 963 sc = iter.Response().Response.Response.StatusCode 964 } 965 tracing.EndSpan(ctx, sc, err) 966 }() 967 } 968 iter.i++ 969 if iter.i < len(iter.page.Values()) { 970 return nil 971 } 972 err = iter.page.NextWithContext(ctx) 973 if err != nil { 974 iter.i-- 975 return err 976 } 977 iter.i = 0 978 return nil 979} 980 981// Next advances to the next value. If there was an error making 982// the request the iterator does not advance and the error is returned. 983// Deprecated: Use NextWithContext() instead. 984func (iter *DeletedCertificateListResultIterator) Next() error { 985 return iter.NextWithContext(context.Background()) 986} 987 988// NotDone returns true if the enumeration should be started or is not yet complete. 989func (iter DeletedCertificateListResultIterator) NotDone() bool { 990 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 991} 992 993// Response returns the raw server response from the last page request. 994func (iter DeletedCertificateListResultIterator) Response() DeletedCertificateListResult { 995 return iter.page.Response() 996} 997 998// Value returns the current value or a zero-initialized value if the 999// iterator has advanced beyond the end of the collection. 1000func (iter DeletedCertificateListResultIterator) Value() DeletedCertificateItem { 1001 if !iter.page.NotDone() { 1002 return DeletedCertificateItem{} 1003 } 1004 return iter.page.Values()[iter.i] 1005} 1006 1007// Creates a new instance of the DeletedCertificateListResultIterator type. 1008func NewDeletedCertificateListResultIterator(page DeletedCertificateListResultPage) DeletedCertificateListResultIterator { 1009 return DeletedCertificateListResultIterator{page: page} 1010} 1011 1012// IsEmpty returns true if the ListResult contains no values. 1013func (dclr DeletedCertificateListResult) IsEmpty() bool { 1014 return dclr.Value == nil || len(*dclr.Value) == 0 1015} 1016 1017// hasNextLink returns true if the NextLink is not empty. 1018func (dclr DeletedCertificateListResult) hasNextLink() bool { 1019 return dclr.NextLink != nil && len(*dclr.NextLink) != 0 1020} 1021 1022// deletedCertificateListResultPreparer prepares a request to retrieve the next set of results. 1023// It returns nil if no more results exist. 1024func (dclr DeletedCertificateListResult) deletedCertificateListResultPreparer(ctx context.Context) (*http.Request, error) { 1025 if !dclr.hasNextLink() { 1026 return nil, nil 1027 } 1028 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1029 autorest.AsJSON(), 1030 autorest.AsGet(), 1031 autorest.WithBaseURL(to.String(dclr.NextLink))) 1032} 1033 1034// DeletedCertificateListResultPage contains a page of DeletedCertificateItem values. 1035type DeletedCertificateListResultPage struct { 1036 fn func(context.Context, DeletedCertificateListResult) (DeletedCertificateListResult, error) 1037 dclr DeletedCertificateListResult 1038} 1039 1040// NextWithContext advances to the next page of values. If there was an error making 1041// the request the page does not advance and the error is returned. 1042func (page *DeletedCertificateListResultPage) NextWithContext(ctx context.Context) (err error) { 1043 if tracing.IsEnabled() { 1044 ctx = tracing.StartSpan(ctx, fqdn+"/DeletedCertificateListResultPage.NextWithContext") 1045 defer func() { 1046 sc := -1 1047 if page.Response().Response.Response != nil { 1048 sc = page.Response().Response.Response.StatusCode 1049 } 1050 tracing.EndSpan(ctx, sc, err) 1051 }() 1052 } 1053 for { 1054 next, err := page.fn(ctx, page.dclr) 1055 if err != nil { 1056 return err 1057 } 1058 page.dclr = next 1059 if !next.hasNextLink() || !next.IsEmpty() { 1060 break 1061 } 1062 } 1063 return nil 1064} 1065 1066// Next advances to the next page of values. If there was an error making 1067// the request the page does not advance and the error is returned. 1068// Deprecated: Use NextWithContext() instead. 1069func (page *DeletedCertificateListResultPage) Next() error { 1070 return page.NextWithContext(context.Background()) 1071} 1072 1073// NotDone returns true if the page enumeration should be started or is not yet complete. 1074func (page DeletedCertificateListResultPage) NotDone() bool { 1075 return !page.dclr.IsEmpty() 1076} 1077 1078// Response returns the raw server response from the last page request. 1079func (page DeletedCertificateListResultPage) Response() DeletedCertificateListResult { 1080 return page.dclr 1081} 1082 1083// Values returns the slice of values for the current page or nil if there are no values. 1084func (page DeletedCertificateListResultPage) Values() []DeletedCertificateItem { 1085 if page.dclr.IsEmpty() { 1086 return nil 1087 } 1088 return *page.dclr.Value 1089} 1090 1091// Creates a new instance of the DeletedCertificateListResultPage type. 1092func NewDeletedCertificateListResultPage(cur DeletedCertificateListResult, getNextPage func(context.Context, DeletedCertificateListResult) (DeletedCertificateListResult, error)) DeletedCertificateListResultPage { 1093 return DeletedCertificateListResultPage{ 1094 fn: getNextPage, 1095 dclr: cur, 1096 } 1097} 1098 1099// DeletedKeyBundle a DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info 1100type DeletedKeyBundle struct { 1101 autorest.Response `json:"-"` 1102 // RecoveryID - The url of the recovery object, used to identify and recover the deleted key. 1103 RecoveryID *string `json:"recoveryId,omitempty"` 1104 // ScheduledPurgeDate - READ-ONLY; The time when the key is scheduled to be purged, in UTC 1105 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 1106 // DeletedDate - READ-ONLY; The time when the key was deleted, in UTC 1107 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 1108 // Key - The Json web key. 1109 Key *JSONWebKey `json:"key,omitempty"` 1110 // Attributes - The key management attributes. 1111 Attributes *KeyAttributes `json:"attributes,omitempty"` 1112 // Tags - Application specific metadata in the form of key-value pairs. 1113 Tags map[string]*string `json:"tags"` 1114 // Managed - READ-ONLY; True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. 1115 Managed *bool `json:"managed,omitempty"` 1116 // ReleasePolicy - The policy rules under which the key can be exported. 1117 ReleasePolicy *KeyReleasePolicy `json:"release_policy,omitempty"` 1118} 1119 1120// MarshalJSON is the custom marshaler for DeletedKeyBundle. 1121func (dkb DeletedKeyBundle) MarshalJSON() ([]byte, error) { 1122 objectMap := make(map[string]interface{}) 1123 if dkb.RecoveryID != nil { 1124 objectMap["recoveryId"] = dkb.RecoveryID 1125 } 1126 if dkb.Key != nil { 1127 objectMap["key"] = dkb.Key 1128 } 1129 if dkb.Attributes != nil { 1130 objectMap["attributes"] = dkb.Attributes 1131 } 1132 if dkb.Tags != nil { 1133 objectMap["tags"] = dkb.Tags 1134 } 1135 if dkb.ReleasePolicy != nil { 1136 objectMap["release_policy"] = dkb.ReleasePolicy 1137 } 1138 return json.Marshal(objectMap) 1139} 1140 1141// DeletedKeyItem the deleted key item containing the deleted key metadata and information about deletion. 1142type DeletedKeyItem struct { 1143 // RecoveryID - The url of the recovery object, used to identify and recover the deleted key. 1144 RecoveryID *string `json:"recoveryId,omitempty"` 1145 // ScheduledPurgeDate - READ-ONLY; The time when the key is scheduled to be purged, in UTC 1146 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 1147 // DeletedDate - READ-ONLY; The time when the key was deleted, in UTC 1148 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 1149 // Kid - Key identifier. 1150 Kid *string `json:"kid,omitempty"` 1151 // Attributes - The key management attributes. 1152 Attributes *KeyAttributes `json:"attributes,omitempty"` 1153 // Tags - Application specific metadata in the form of key-value pairs. 1154 Tags map[string]*string `json:"tags"` 1155 // Managed - READ-ONLY; True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. 1156 Managed *bool `json:"managed,omitempty"` 1157} 1158 1159// MarshalJSON is the custom marshaler for DeletedKeyItem. 1160func (dki DeletedKeyItem) MarshalJSON() ([]byte, error) { 1161 objectMap := make(map[string]interface{}) 1162 if dki.RecoveryID != nil { 1163 objectMap["recoveryId"] = dki.RecoveryID 1164 } 1165 if dki.Kid != nil { 1166 objectMap["kid"] = dki.Kid 1167 } 1168 if dki.Attributes != nil { 1169 objectMap["attributes"] = dki.Attributes 1170 } 1171 if dki.Tags != nil { 1172 objectMap["tags"] = dki.Tags 1173 } 1174 return json.Marshal(objectMap) 1175} 1176 1177// DeletedKeyListResult a list of keys that have been deleted in this vault. 1178type DeletedKeyListResult struct { 1179 autorest.Response `json:"-"` 1180 // Value - READ-ONLY; A response message containing a list of deleted keys in the vault along with a link to the next page of deleted keys 1181 Value *[]DeletedKeyItem `json:"value,omitempty"` 1182 // NextLink - READ-ONLY; The URL to get the next set of deleted keys. 1183 NextLink *string `json:"nextLink,omitempty"` 1184} 1185 1186// MarshalJSON is the custom marshaler for DeletedKeyListResult. 1187func (dklr DeletedKeyListResult) MarshalJSON() ([]byte, error) { 1188 objectMap := make(map[string]interface{}) 1189 return json.Marshal(objectMap) 1190} 1191 1192// DeletedKeyListResultIterator provides access to a complete listing of DeletedKeyItem values. 1193type DeletedKeyListResultIterator struct { 1194 i int 1195 page DeletedKeyListResultPage 1196} 1197 1198// NextWithContext advances to the next value. If there was an error making 1199// the request the iterator does not advance and the error is returned. 1200func (iter *DeletedKeyListResultIterator) NextWithContext(ctx context.Context) (err error) { 1201 if tracing.IsEnabled() { 1202 ctx = tracing.StartSpan(ctx, fqdn+"/DeletedKeyListResultIterator.NextWithContext") 1203 defer func() { 1204 sc := -1 1205 if iter.Response().Response.Response != nil { 1206 sc = iter.Response().Response.Response.StatusCode 1207 } 1208 tracing.EndSpan(ctx, sc, err) 1209 }() 1210 } 1211 iter.i++ 1212 if iter.i < len(iter.page.Values()) { 1213 return nil 1214 } 1215 err = iter.page.NextWithContext(ctx) 1216 if err != nil { 1217 iter.i-- 1218 return err 1219 } 1220 iter.i = 0 1221 return nil 1222} 1223 1224// Next advances to the next value. If there was an error making 1225// the request the iterator does not advance and the error is returned. 1226// Deprecated: Use NextWithContext() instead. 1227func (iter *DeletedKeyListResultIterator) Next() error { 1228 return iter.NextWithContext(context.Background()) 1229} 1230 1231// NotDone returns true if the enumeration should be started or is not yet complete. 1232func (iter DeletedKeyListResultIterator) NotDone() bool { 1233 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1234} 1235 1236// Response returns the raw server response from the last page request. 1237func (iter DeletedKeyListResultIterator) Response() DeletedKeyListResult { 1238 return iter.page.Response() 1239} 1240 1241// Value returns the current value or a zero-initialized value if the 1242// iterator has advanced beyond the end of the collection. 1243func (iter DeletedKeyListResultIterator) Value() DeletedKeyItem { 1244 if !iter.page.NotDone() { 1245 return DeletedKeyItem{} 1246 } 1247 return iter.page.Values()[iter.i] 1248} 1249 1250// Creates a new instance of the DeletedKeyListResultIterator type. 1251func NewDeletedKeyListResultIterator(page DeletedKeyListResultPage) DeletedKeyListResultIterator { 1252 return DeletedKeyListResultIterator{page: page} 1253} 1254 1255// IsEmpty returns true if the ListResult contains no values. 1256func (dklr DeletedKeyListResult) IsEmpty() bool { 1257 return dklr.Value == nil || len(*dklr.Value) == 0 1258} 1259 1260// hasNextLink returns true if the NextLink is not empty. 1261func (dklr DeletedKeyListResult) hasNextLink() bool { 1262 return dklr.NextLink != nil && len(*dklr.NextLink) != 0 1263} 1264 1265// deletedKeyListResultPreparer prepares a request to retrieve the next set of results. 1266// It returns nil if no more results exist. 1267func (dklr DeletedKeyListResult) deletedKeyListResultPreparer(ctx context.Context) (*http.Request, error) { 1268 if !dklr.hasNextLink() { 1269 return nil, nil 1270 } 1271 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1272 autorest.AsJSON(), 1273 autorest.AsGet(), 1274 autorest.WithBaseURL(to.String(dklr.NextLink))) 1275} 1276 1277// DeletedKeyListResultPage contains a page of DeletedKeyItem values. 1278type DeletedKeyListResultPage struct { 1279 fn func(context.Context, DeletedKeyListResult) (DeletedKeyListResult, error) 1280 dklr DeletedKeyListResult 1281} 1282 1283// NextWithContext advances to the next page of values. If there was an error making 1284// the request the page does not advance and the error is returned. 1285func (page *DeletedKeyListResultPage) NextWithContext(ctx context.Context) (err error) { 1286 if tracing.IsEnabled() { 1287 ctx = tracing.StartSpan(ctx, fqdn+"/DeletedKeyListResultPage.NextWithContext") 1288 defer func() { 1289 sc := -1 1290 if page.Response().Response.Response != nil { 1291 sc = page.Response().Response.Response.StatusCode 1292 } 1293 tracing.EndSpan(ctx, sc, err) 1294 }() 1295 } 1296 for { 1297 next, err := page.fn(ctx, page.dklr) 1298 if err != nil { 1299 return err 1300 } 1301 page.dklr = next 1302 if !next.hasNextLink() || !next.IsEmpty() { 1303 break 1304 } 1305 } 1306 return nil 1307} 1308 1309// Next advances to the next page of values. If there was an error making 1310// the request the page does not advance and the error is returned. 1311// Deprecated: Use NextWithContext() instead. 1312func (page *DeletedKeyListResultPage) Next() error { 1313 return page.NextWithContext(context.Background()) 1314} 1315 1316// NotDone returns true if the page enumeration should be started or is not yet complete. 1317func (page DeletedKeyListResultPage) NotDone() bool { 1318 return !page.dklr.IsEmpty() 1319} 1320 1321// Response returns the raw server response from the last page request. 1322func (page DeletedKeyListResultPage) Response() DeletedKeyListResult { 1323 return page.dklr 1324} 1325 1326// Values returns the slice of values for the current page or nil if there are no values. 1327func (page DeletedKeyListResultPage) Values() []DeletedKeyItem { 1328 if page.dklr.IsEmpty() { 1329 return nil 1330 } 1331 return *page.dklr.Value 1332} 1333 1334// Creates a new instance of the DeletedKeyListResultPage type. 1335func NewDeletedKeyListResultPage(cur DeletedKeyListResult, getNextPage func(context.Context, DeletedKeyListResult) (DeletedKeyListResult, error)) DeletedKeyListResultPage { 1336 return DeletedKeyListResultPage{ 1337 fn: getNextPage, 1338 dklr: cur, 1339 } 1340} 1341 1342// DeletedSasDefinitionBundle a deleted SAS definition bundle consisting of its previous id, attributes and 1343// its tags, as well as information on when it will be purged. 1344type DeletedSasDefinitionBundle struct { 1345 autorest.Response `json:"-"` 1346 // RecoveryID - The url of the recovery object, used to identify and recover the deleted SAS definition. 1347 RecoveryID *string `json:"recoveryId,omitempty"` 1348 // ScheduledPurgeDate - READ-ONLY; The time when the SAS definition is scheduled to be purged, in UTC 1349 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 1350 // DeletedDate - READ-ONLY; The time when the SAS definition was deleted, in UTC 1351 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 1352 // ID - READ-ONLY; The SAS definition id. 1353 ID *string `json:"id,omitempty"` 1354 // SecretID - READ-ONLY; Storage account SAS definition secret id. 1355 SecretID *string `json:"sid,omitempty"` 1356 // TemplateURI - READ-ONLY; 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. 1357 TemplateURI *string `json:"templateUri,omitempty"` 1358 // SasType - READ-ONLY; The type of SAS token the SAS definition will create. Possible values include: 'Account', 'Service' 1359 SasType SasTokenType `json:"sasType,omitempty"` 1360 // ValidityPeriod - READ-ONLY; The validity period of SAS tokens created according to the SAS definition. 1361 ValidityPeriod *string `json:"validityPeriod,omitempty"` 1362 // Attributes - READ-ONLY; The SAS definition attributes. 1363 Attributes *SasDefinitionAttributes `json:"attributes,omitempty"` 1364 // Tags - READ-ONLY; Application specific metadata in the form of key-value pairs 1365 Tags map[string]*string `json:"tags"` 1366} 1367 1368// MarshalJSON is the custom marshaler for DeletedSasDefinitionBundle. 1369func (dsdb DeletedSasDefinitionBundle) MarshalJSON() ([]byte, error) { 1370 objectMap := make(map[string]interface{}) 1371 if dsdb.RecoveryID != nil { 1372 objectMap["recoveryId"] = dsdb.RecoveryID 1373 } 1374 return json.Marshal(objectMap) 1375} 1376 1377// DeletedSasDefinitionItem the deleted SAS definition item containing metadata about the deleted SAS 1378// definition. 1379type DeletedSasDefinitionItem struct { 1380 // RecoveryID - The url of the recovery object, used to identify and recover the deleted SAS definition. 1381 RecoveryID *string `json:"recoveryId,omitempty"` 1382 // ScheduledPurgeDate - READ-ONLY; The time when the SAS definition is scheduled to be purged, in UTC 1383 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 1384 // DeletedDate - READ-ONLY; The time when the SAS definition was deleted, in UTC 1385 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 1386 // ID - READ-ONLY; The storage SAS identifier. 1387 ID *string `json:"id,omitempty"` 1388 // SecretID - READ-ONLY; The storage account SAS definition secret id. 1389 SecretID *string `json:"sid,omitempty"` 1390 // Attributes - READ-ONLY; The SAS definition management attributes. 1391 Attributes *SasDefinitionAttributes `json:"attributes,omitempty"` 1392 // Tags - READ-ONLY; Application specific metadata in the form of key-value pairs. 1393 Tags map[string]*string `json:"tags"` 1394} 1395 1396// MarshalJSON is the custom marshaler for DeletedSasDefinitionItem. 1397func (dsdi DeletedSasDefinitionItem) MarshalJSON() ([]byte, error) { 1398 objectMap := make(map[string]interface{}) 1399 if dsdi.RecoveryID != nil { 1400 objectMap["recoveryId"] = dsdi.RecoveryID 1401 } 1402 return json.Marshal(objectMap) 1403} 1404 1405// DeletedSasDefinitionListResult the deleted SAS definition list result 1406type DeletedSasDefinitionListResult struct { 1407 autorest.Response `json:"-"` 1408 // Value - READ-ONLY; 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 1409 Value *[]DeletedSasDefinitionItem `json:"value,omitempty"` 1410 // NextLink - READ-ONLY; The URL to get the next set of deleted SAS definitions. 1411 NextLink *string `json:"nextLink,omitempty"` 1412} 1413 1414// MarshalJSON is the custom marshaler for DeletedSasDefinitionListResult. 1415func (dsdlr DeletedSasDefinitionListResult) MarshalJSON() ([]byte, error) { 1416 objectMap := make(map[string]interface{}) 1417 return json.Marshal(objectMap) 1418} 1419 1420// DeletedSasDefinitionListResultIterator provides access to a complete listing of DeletedSasDefinitionItem 1421// values. 1422type DeletedSasDefinitionListResultIterator struct { 1423 i int 1424 page DeletedSasDefinitionListResultPage 1425} 1426 1427// NextWithContext advances to the next value. If there was an error making 1428// the request the iterator does not advance and the error is returned. 1429func (iter *DeletedSasDefinitionListResultIterator) NextWithContext(ctx context.Context) (err error) { 1430 if tracing.IsEnabled() { 1431 ctx = tracing.StartSpan(ctx, fqdn+"/DeletedSasDefinitionListResultIterator.NextWithContext") 1432 defer func() { 1433 sc := -1 1434 if iter.Response().Response.Response != nil { 1435 sc = iter.Response().Response.Response.StatusCode 1436 } 1437 tracing.EndSpan(ctx, sc, err) 1438 }() 1439 } 1440 iter.i++ 1441 if iter.i < len(iter.page.Values()) { 1442 return nil 1443 } 1444 err = iter.page.NextWithContext(ctx) 1445 if err != nil { 1446 iter.i-- 1447 return err 1448 } 1449 iter.i = 0 1450 return nil 1451} 1452 1453// Next advances to the next value. If there was an error making 1454// the request the iterator does not advance and the error is returned. 1455// Deprecated: Use NextWithContext() instead. 1456func (iter *DeletedSasDefinitionListResultIterator) Next() error { 1457 return iter.NextWithContext(context.Background()) 1458} 1459 1460// NotDone returns true if the enumeration should be started or is not yet complete. 1461func (iter DeletedSasDefinitionListResultIterator) NotDone() bool { 1462 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1463} 1464 1465// Response returns the raw server response from the last page request. 1466func (iter DeletedSasDefinitionListResultIterator) Response() DeletedSasDefinitionListResult { 1467 return iter.page.Response() 1468} 1469 1470// Value returns the current value or a zero-initialized value if the 1471// iterator has advanced beyond the end of the collection. 1472func (iter DeletedSasDefinitionListResultIterator) Value() DeletedSasDefinitionItem { 1473 if !iter.page.NotDone() { 1474 return DeletedSasDefinitionItem{} 1475 } 1476 return iter.page.Values()[iter.i] 1477} 1478 1479// Creates a new instance of the DeletedSasDefinitionListResultIterator type. 1480func NewDeletedSasDefinitionListResultIterator(page DeletedSasDefinitionListResultPage) DeletedSasDefinitionListResultIterator { 1481 return DeletedSasDefinitionListResultIterator{page: page} 1482} 1483 1484// IsEmpty returns true if the ListResult contains no values. 1485func (dsdlr DeletedSasDefinitionListResult) IsEmpty() bool { 1486 return dsdlr.Value == nil || len(*dsdlr.Value) == 0 1487} 1488 1489// hasNextLink returns true if the NextLink is not empty. 1490func (dsdlr DeletedSasDefinitionListResult) hasNextLink() bool { 1491 return dsdlr.NextLink != nil && len(*dsdlr.NextLink) != 0 1492} 1493 1494// deletedSasDefinitionListResultPreparer prepares a request to retrieve the next set of results. 1495// It returns nil if no more results exist. 1496func (dsdlr DeletedSasDefinitionListResult) deletedSasDefinitionListResultPreparer(ctx context.Context) (*http.Request, error) { 1497 if !dsdlr.hasNextLink() { 1498 return nil, nil 1499 } 1500 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1501 autorest.AsJSON(), 1502 autorest.AsGet(), 1503 autorest.WithBaseURL(to.String(dsdlr.NextLink))) 1504} 1505 1506// DeletedSasDefinitionListResultPage contains a page of DeletedSasDefinitionItem values. 1507type DeletedSasDefinitionListResultPage struct { 1508 fn func(context.Context, DeletedSasDefinitionListResult) (DeletedSasDefinitionListResult, error) 1509 dsdlr DeletedSasDefinitionListResult 1510} 1511 1512// NextWithContext advances to the next page of values. If there was an error making 1513// the request the page does not advance and the error is returned. 1514func (page *DeletedSasDefinitionListResultPage) NextWithContext(ctx context.Context) (err error) { 1515 if tracing.IsEnabled() { 1516 ctx = tracing.StartSpan(ctx, fqdn+"/DeletedSasDefinitionListResultPage.NextWithContext") 1517 defer func() { 1518 sc := -1 1519 if page.Response().Response.Response != nil { 1520 sc = page.Response().Response.Response.StatusCode 1521 } 1522 tracing.EndSpan(ctx, sc, err) 1523 }() 1524 } 1525 for { 1526 next, err := page.fn(ctx, page.dsdlr) 1527 if err != nil { 1528 return err 1529 } 1530 page.dsdlr = next 1531 if !next.hasNextLink() || !next.IsEmpty() { 1532 break 1533 } 1534 } 1535 return nil 1536} 1537 1538// Next advances to the next page of values. If there was an error making 1539// the request the page does not advance and the error is returned. 1540// Deprecated: Use NextWithContext() instead. 1541func (page *DeletedSasDefinitionListResultPage) Next() error { 1542 return page.NextWithContext(context.Background()) 1543} 1544 1545// NotDone returns true if the page enumeration should be started or is not yet complete. 1546func (page DeletedSasDefinitionListResultPage) NotDone() bool { 1547 return !page.dsdlr.IsEmpty() 1548} 1549 1550// Response returns the raw server response from the last page request. 1551func (page DeletedSasDefinitionListResultPage) Response() DeletedSasDefinitionListResult { 1552 return page.dsdlr 1553} 1554 1555// Values returns the slice of values for the current page or nil if there are no values. 1556func (page DeletedSasDefinitionListResultPage) Values() []DeletedSasDefinitionItem { 1557 if page.dsdlr.IsEmpty() { 1558 return nil 1559 } 1560 return *page.dsdlr.Value 1561} 1562 1563// Creates a new instance of the DeletedSasDefinitionListResultPage type. 1564func NewDeletedSasDefinitionListResultPage(cur DeletedSasDefinitionListResult, getNextPage func(context.Context, DeletedSasDefinitionListResult) (DeletedSasDefinitionListResult, error)) DeletedSasDefinitionListResultPage { 1565 return DeletedSasDefinitionListResultPage{ 1566 fn: getNextPage, 1567 dsdlr: cur, 1568 } 1569} 1570 1571// DeletedSecretBundle a Deleted Secret consisting of its previous id, attributes and its tags, as well as 1572// information on when it will be purged. 1573type DeletedSecretBundle struct { 1574 autorest.Response `json:"-"` 1575 // RecoveryID - The url of the recovery object, used to identify and recover the deleted secret. 1576 RecoveryID *string `json:"recoveryId,omitempty"` 1577 // ScheduledPurgeDate - READ-ONLY; The time when the secret is scheduled to be purged, in UTC 1578 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 1579 // DeletedDate - READ-ONLY; The time when the secret was deleted, in UTC 1580 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 1581 // Value - The secret value. 1582 Value *string `json:"value,omitempty"` 1583 // ID - The secret id. 1584 ID *string `json:"id,omitempty"` 1585 // ContentType - The content type of the secret. 1586 ContentType *string `json:"contentType,omitempty"` 1587 // Attributes - The secret management attributes. 1588 Attributes *SecretAttributes `json:"attributes,omitempty"` 1589 // Tags - Application specific metadata in the form of key-value pairs. 1590 Tags map[string]*string `json:"tags"` 1591 // Kid - READ-ONLY; If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate. 1592 Kid *string `json:"kid,omitempty"` 1593 // Managed - READ-ONLY; True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be true. 1594 Managed *bool `json:"managed,omitempty"` 1595} 1596 1597// MarshalJSON is the custom marshaler for DeletedSecretBundle. 1598func (dsb DeletedSecretBundle) MarshalJSON() ([]byte, error) { 1599 objectMap := make(map[string]interface{}) 1600 if dsb.RecoveryID != nil { 1601 objectMap["recoveryId"] = dsb.RecoveryID 1602 } 1603 if dsb.Value != nil { 1604 objectMap["value"] = dsb.Value 1605 } 1606 if dsb.ID != nil { 1607 objectMap["id"] = dsb.ID 1608 } 1609 if dsb.ContentType != nil { 1610 objectMap["contentType"] = dsb.ContentType 1611 } 1612 if dsb.Attributes != nil { 1613 objectMap["attributes"] = dsb.Attributes 1614 } 1615 if dsb.Tags != nil { 1616 objectMap["tags"] = dsb.Tags 1617 } 1618 return json.Marshal(objectMap) 1619} 1620 1621// DeletedSecretItem the deleted secret item containing metadata about the deleted secret. 1622type DeletedSecretItem struct { 1623 // RecoveryID - The url of the recovery object, used to identify and recover the deleted secret. 1624 RecoveryID *string `json:"recoveryId,omitempty"` 1625 // ScheduledPurgeDate - READ-ONLY; The time when the secret is scheduled to be purged, in UTC 1626 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 1627 // DeletedDate - READ-ONLY; The time when the secret was deleted, in UTC 1628 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 1629 // ID - Secret identifier. 1630 ID *string `json:"id,omitempty"` 1631 // Attributes - The secret management attributes. 1632 Attributes *SecretAttributes `json:"attributes,omitempty"` 1633 // Tags - Application specific metadata in the form of key-value pairs. 1634 Tags map[string]*string `json:"tags"` 1635 // ContentType - Type of the secret value such as a password. 1636 ContentType *string `json:"contentType,omitempty"` 1637 // Managed - READ-ONLY; True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. 1638 Managed *bool `json:"managed,omitempty"` 1639} 1640 1641// MarshalJSON is the custom marshaler for DeletedSecretItem. 1642func (dsi DeletedSecretItem) MarshalJSON() ([]byte, error) { 1643 objectMap := make(map[string]interface{}) 1644 if dsi.RecoveryID != nil { 1645 objectMap["recoveryId"] = dsi.RecoveryID 1646 } 1647 if dsi.ID != nil { 1648 objectMap["id"] = dsi.ID 1649 } 1650 if dsi.Attributes != nil { 1651 objectMap["attributes"] = dsi.Attributes 1652 } 1653 if dsi.Tags != nil { 1654 objectMap["tags"] = dsi.Tags 1655 } 1656 if dsi.ContentType != nil { 1657 objectMap["contentType"] = dsi.ContentType 1658 } 1659 return json.Marshal(objectMap) 1660} 1661 1662// DeletedSecretListResult the deleted secret list result 1663type DeletedSecretListResult struct { 1664 autorest.Response `json:"-"` 1665 // Value - READ-ONLY; A response message containing a list of the deleted secrets in the vault along with a link to the next page of deleted secrets 1666 Value *[]DeletedSecretItem `json:"value,omitempty"` 1667 // NextLink - READ-ONLY; The URL to get the next set of deleted secrets. 1668 NextLink *string `json:"nextLink,omitempty"` 1669} 1670 1671// MarshalJSON is the custom marshaler for DeletedSecretListResult. 1672func (dslr DeletedSecretListResult) MarshalJSON() ([]byte, error) { 1673 objectMap := make(map[string]interface{}) 1674 return json.Marshal(objectMap) 1675} 1676 1677// DeletedSecretListResultIterator provides access to a complete listing of DeletedSecretItem values. 1678type DeletedSecretListResultIterator struct { 1679 i int 1680 page DeletedSecretListResultPage 1681} 1682 1683// NextWithContext advances to the next value. If there was an error making 1684// the request the iterator does not advance and the error is returned. 1685func (iter *DeletedSecretListResultIterator) NextWithContext(ctx context.Context) (err error) { 1686 if tracing.IsEnabled() { 1687 ctx = tracing.StartSpan(ctx, fqdn+"/DeletedSecretListResultIterator.NextWithContext") 1688 defer func() { 1689 sc := -1 1690 if iter.Response().Response.Response != nil { 1691 sc = iter.Response().Response.Response.StatusCode 1692 } 1693 tracing.EndSpan(ctx, sc, err) 1694 }() 1695 } 1696 iter.i++ 1697 if iter.i < len(iter.page.Values()) { 1698 return nil 1699 } 1700 err = iter.page.NextWithContext(ctx) 1701 if err != nil { 1702 iter.i-- 1703 return err 1704 } 1705 iter.i = 0 1706 return nil 1707} 1708 1709// Next advances to the next value. If there was an error making 1710// the request the iterator does not advance and the error is returned. 1711// Deprecated: Use NextWithContext() instead. 1712func (iter *DeletedSecretListResultIterator) Next() error { 1713 return iter.NextWithContext(context.Background()) 1714} 1715 1716// NotDone returns true if the enumeration should be started or is not yet complete. 1717func (iter DeletedSecretListResultIterator) NotDone() bool { 1718 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1719} 1720 1721// Response returns the raw server response from the last page request. 1722func (iter DeletedSecretListResultIterator) Response() DeletedSecretListResult { 1723 return iter.page.Response() 1724} 1725 1726// Value returns the current value or a zero-initialized value if the 1727// iterator has advanced beyond the end of the collection. 1728func (iter DeletedSecretListResultIterator) Value() DeletedSecretItem { 1729 if !iter.page.NotDone() { 1730 return DeletedSecretItem{} 1731 } 1732 return iter.page.Values()[iter.i] 1733} 1734 1735// Creates a new instance of the DeletedSecretListResultIterator type. 1736func NewDeletedSecretListResultIterator(page DeletedSecretListResultPage) DeletedSecretListResultIterator { 1737 return DeletedSecretListResultIterator{page: page} 1738} 1739 1740// IsEmpty returns true if the ListResult contains no values. 1741func (dslr DeletedSecretListResult) IsEmpty() bool { 1742 return dslr.Value == nil || len(*dslr.Value) == 0 1743} 1744 1745// hasNextLink returns true if the NextLink is not empty. 1746func (dslr DeletedSecretListResult) hasNextLink() bool { 1747 return dslr.NextLink != nil && len(*dslr.NextLink) != 0 1748} 1749 1750// deletedSecretListResultPreparer prepares a request to retrieve the next set of results. 1751// It returns nil if no more results exist. 1752func (dslr DeletedSecretListResult) deletedSecretListResultPreparer(ctx context.Context) (*http.Request, error) { 1753 if !dslr.hasNextLink() { 1754 return nil, nil 1755 } 1756 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1757 autorest.AsJSON(), 1758 autorest.AsGet(), 1759 autorest.WithBaseURL(to.String(dslr.NextLink))) 1760} 1761 1762// DeletedSecretListResultPage contains a page of DeletedSecretItem values. 1763type DeletedSecretListResultPage struct { 1764 fn func(context.Context, DeletedSecretListResult) (DeletedSecretListResult, error) 1765 dslr DeletedSecretListResult 1766} 1767 1768// NextWithContext advances to the next page of values. If there was an error making 1769// the request the page does not advance and the error is returned. 1770func (page *DeletedSecretListResultPage) NextWithContext(ctx context.Context) (err error) { 1771 if tracing.IsEnabled() { 1772 ctx = tracing.StartSpan(ctx, fqdn+"/DeletedSecretListResultPage.NextWithContext") 1773 defer func() { 1774 sc := -1 1775 if page.Response().Response.Response != nil { 1776 sc = page.Response().Response.Response.StatusCode 1777 } 1778 tracing.EndSpan(ctx, sc, err) 1779 }() 1780 } 1781 for { 1782 next, err := page.fn(ctx, page.dslr) 1783 if err != nil { 1784 return err 1785 } 1786 page.dslr = next 1787 if !next.hasNextLink() || !next.IsEmpty() { 1788 break 1789 } 1790 } 1791 return nil 1792} 1793 1794// Next advances to the next page of values. If there was an error making 1795// the request the page does not advance and the error is returned. 1796// Deprecated: Use NextWithContext() instead. 1797func (page *DeletedSecretListResultPage) Next() error { 1798 return page.NextWithContext(context.Background()) 1799} 1800 1801// NotDone returns true if the page enumeration should be started or is not yet complete. 1802func (page DeletedSecretListResultPage) NotDone() bool { 1803 return !page.dslr.IsEmpty() 1804} 1805 1806// Response returns the raw server response from the last page request. 1807func (page DeletedSecretListResultPage) Response() DeletedSecretListResult { 1808 return page.dslr 1809} 1810 1811// Values returns the slice of values for the current page or nil if there are no values. 1812func (page DeletedSecretListResultPage) Values() []DeletedSecretItem { 1813 if page.dslr.IsEmpty() { 1814 return nil 1815 } 1816 return *page.dslr.Value 1817} 1818 1819// Creates a new instance of the DeletedSecretListResultPage type. 1820func NewDeletedSecretListResultPage(cur DeletedSecretListResult, getNextPage func(context.Context, DeletedSecretListResult) (DeletedSecretListResult, error)) DeletedSecretListResultPage { 1821 return DeletedSecretListResultPage{ 1822 fn: getNextPage, 1823 dslr: cur, 1824 } 1825} 1826 1827// DeletedStorageAccountItem the deleted storage account item containing metadata about the deleted storage 1828// account. 1829type DeletedStorageAccountItem struct { 1830 // RecoveryID - The url of the recovery object, used to identify and recover the deleted storage account. 1831 RecoveryID *string `json:"recoveryId,omitempty"` 1832 // ScheduledPurgeDate - READ-ONLY; The time when the storage account is scheduled to be purged, in UTC 1833 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 1834 // DeletedDate - READ-ONLY; The time when the storage account was deleted, in UTC 1835 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 1836 // ID - READ-ONLY; Storage identifier. 1837 ID *string `json:"id,omitempty"` 1838 // ResourceID - READ-ONLY; Storage account resource Id. 1839 ResourceID *string `json:"resourceId,omitempty"` 1840 // Attributes - READ-ONLY; The storage account management attributes. 1841 Attributes *StorageAccountAttributes `json:"attributes,omitempty"` 1842 // Tags - READ-ONLY; Application specific metadata in the form of key-value pairs. 1843 Tags map[string]*string `json:"tags"` 1844} 1845 1846// MarshalJSON is the custom marshaler for DeletedStorageAccountItem. 1847func (dsai DeletedStorageAccountItem) MarshalJSON() ([]byte, error) { 1848 objectMap := make(map[string]interface{}) 1849 if dsai.RecoveryID != nil { 1850 objectMap["recoveryId"] = dsai.RecoveryID 1851 } 1852 return json.Marshal(objectMap) 1853} 1854 1855// DeletedStorageBundle a deleted storage account bundle consisting of its previous id, attributes and its 1856// tags, as well as information on when it will be purged. 1857type DeletedStorageBundle struct { 1858 autorest.Response `json:"-"` 1859 // RecoveryID - The url of the recovery object, used to identify and recover the deleted storage account. 1860 RecoveryID *string `json:"recoveryId,omitempty"` 1861 // ScheduledPurgeDate - READ-ONLY; The time when the storage account is scheduled to be purged, in UTC 1862 ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` 1863 // DeletedDate - READ-ONLY; The time when the storage account was deleted, in UTC 1864 DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` 1865 // ID - READ-ONLY; The storage account id. 1866 ID *string `json:"id,omitempty"` 1867 // ResourceID - READ-ONLY; The storage account resource id. 1868 ResourceID *string `json:"resourceId,omitempty"` 1869 // ActiveKeyName - READ-ONLY; The current active storage account key name. 1870 ActiveKeyName *string `json:"activeKeyName,omitempty"` 1871 // AutoRegenerateKey - READ-ONLY; whether keyvault should manage the storage account for the user. 1872 AutoRegenerateKey *bool `json:"autoRegenerateKey,omitempty"` 1873 // RegenerationPeriod - READ-ONLY; The key regeneration time duration specified in ISO-8601 format. 1874 RegenerationPeriod *string `json:"regenerationPeriod,omitempty"` 1875 // Attributes - READ-ONLY; The storage account attributes. 1876 Attributes *StorageAccountAttributes `json:"attributes,omitempty"` 1877 // Tags - READ-ONLY; Application specific metadata in the form of key-value pairs 1878 Tags map[string]*string `json:"tags"` 1879} 1880 1881// MarshalJSON is the custom marshaler for DeletedStorageBundle. 1882func (dsb DeletedStorageBundle) MarshalJSON() ([]byte, error) { 1883 objectMap := make(map[string]interface{}) 1884 if dsb.RecoveryID != nil { 1885 objectMap["recoveryId"] = dsb.RecoveryID 1886 } 1887 return json.Marshal(objectMap) 1888} 1889 1890// DeletedStorageListResult the deleted storage account list result 1891type DeletedStorageListResult struct { 1892 autorest.Response `json:"-"` 1893 // Value - READ-ONLY; 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 1894 Value *[]DeletedStorageAccountItem `json:"value,omitempty"` 1895 // NextLink - READ-ONLY; The URL to get the next set of deleted storage accounts. 1896 NextLink *string `json:"nextLink,omitempty"` 1897} 1898 1899// MarshalJSON is the custom marshaler for DeletedStorageListResult. 1900func (dslr DeletedStorageListResult) MarshalJSON() ([]byte, error) { 1901 objectMap := make(map[string]interface{}) 1902 return json.Marshal(objectMap) 1903} 1904 1905// DeletedStorageListResultIterator provides access to a complete listing of DeletedStorageAccountItem 1906// values. 1907type DeletedStorageListResultIterator struct { 1908 i int 1909 page DeletedStorageListResultPage 1910} 1911 1912// NextWithContext advances to the next value. If there was an error making 1913// the request the iterator does not advance and the error is returned. 1914func (iter *DeletedStorageListResultIterator) NextWithContext(ctx context.Context) (err error) { 1915 if tracing.IsEnabled() { 1916 ctx = tracing.StartSpan(ctx, fqdn+"/DeletedStorageListResultIterator.NextWithContext") 1917 defer func() { 1918 sc := -1 1919 if iter.Response().Response.Response != nil { 1920 sc = iter.Response().Response.Response.StatusCode 1921 } 1922 tracing.EndSpan(ctx, sc, err) 1923 }() 1924 } 1925 iter.i++ 1926 if iter.i < len(iter.page.Values()) { 1927 return nil 1928 } 1929 err = iter.page.NextWithContext(ctx) 1930 if err != nil { 1931 iter.i-- 1932 return err 1933 } 1934 iter.i = 0 1935 return nil 1936} 1937 1938// Next advances to the next value. If there was an error making 1939// the request the iterator does not advance and the error is returned. 1940// Deprecated: Use NextWithContext() instead. 1941func (iter *DeletedStorageListResultIterator) Next() error { 1942 return iter.NextWithContext(context.Background()) 1943} 1944 1945// NotDone returns true if the enumeration should be started or is not yet complete. 1946func (iter DeletedStorageListResultIterator) NotDone() bool { 1947 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1948} 1949 1950// Response returns the raw server response from the last page request. 1951func (iter DeletedStorageListResultIterator) Response() DeletedStorageListResult { 1952 return iter.page.Response() 1953} 1954 1955// Value returns the current value or a zero-initialized value if the 1956// iterator has advanced beyond the end of the collection. 1957func (iter DeletedStorageListResultIterator) Value() DeletedStorageAccountItem { 1958 if !iter.page.NotDone() { 1959 return DeletedStorageAccountItem{} 1960 } 1961 return iter.page.Values()[iter.i] 1962} 1963 1964// Creates a new instance of the DeletedStorageListResultIterator type. 1965func NewDeletedStorageListResultIterator(page DeletedStorageListResultPage) DeletedStorageListResultIterator { 1966 return DeletedStorageListResultIterator{page: page} 1967} 1968 1969// IsEmpty returns true if the ListResult contains no values. 1970func (dslr DeletedStorageListResult) IsEmpty() bool { 1971 return dslr.Value == nil || len(*dslr.Value) == 0 1972} 1973 1974// hasNextLink returns true if the NextLink is not empty. 1975func (dslr DeletedStorageListResult) hasNextLink() bool { 1976 return dslr.NextLink != nil && len(*dslr.NextLink) != 0 1977} 1978 1979// deletedStorageListResultPreparer prepares a request to retrieve the next set of results. 1980// It returns nil if no more results exist. 1981func (dslr DeletedStorageListResult) deletedStorageListResultPreparer(ctx context.Context) (*http.Request, error) { 1982 if !dslr.hasNextLink() { 1983 return nil, nil 1984 } 1985 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1986 autorest.AsJSON(), 1987 autorest.AsGet(), 1988 autorest.WithBaseURL(to.String(dslr.NextLink))) 1989} 1990 1991// DeletedStorageListResultPage contains a page of DeletedStorageAccountItem values. 1992type DeletedStorageListResultPage struct { 1993 fn func(context.Context, DeletedStorageListResult) (DeletedStorageListResult, error) 1994 dslr DeletedStorageListResult 1995} 1996 1997// NextWithContext advances to the next page of values. If there was an error making 1998// the request the page does not advance and the error is returned. 1999func (page *DeletedStorageListResultPage) NextWithContext(ctx context.Context) (err error) { 2000 if tracing.IsEnabled() { 2001 ctx = tracing.StartSpan(ctx, fqdn+"/DeletedStorageListResultPage.NextWithContext") 2002 defer func() { 2003 sc := -1 2004 if page.Response().Response.Response != nil { 2005 sc = page.Response().Response.Response.StatusCode 2006 } 2007 tracing.EndSpan(ctx, sc, err) 2008 }() 2009 } 2010 for { 2011 next, err := page.fn(ctx, page.dslr) 2012 if err != nil { 2013 return err 2014 } 2015 page.dslr = next 2016 if !next.hasNextLink() || !next.IsEmpty() { 2017 break 2018 } 2019 } 2020 return nil 2021} 2022 2023// Next advances to the next page of values. If there was an error making 2024// the request the page does not advance and the error is returned. 2025// Deprecated: Use NextWithContext() instead. 2026func (page *DeletedStorageListResultPage) Next() error { 2027 return page.NextWithContext(context.Background()) 2028} 2029 2030// NotDone returns true if the page enumeration should be started or is not yet complete. 2031func (page DeletedStorageListResultPage) NotDone() bool { 2032 return !page.dslr.IsEmpty() 2033} 2034 2035// Response returns the raw server response from the last page request. 2036func (page DeletedStorageListResultPage) Response() DeletedStorageListResult { 2037 return page.dslr 2038} 2039 2040// Values returns the slice of values for the current page or nil if there are no values. 2041func (page DeletedStorageListResultPage) Values() []DeletedStorageAccountItem { 2042 if page.dslr.IsEmpty() { 2043 return nil 2044 } 2045 return *page.dslr.Value 2046} 2047 2048// Creates a new instance of the DeletedStorageListResultPage type. 2049func NewDeletedStorageListResultPage(cur DeletedStorageListResult, getNextPage func(context.Context, DeletedStorageListResult) (DeletedStorageListResult, error)) DeletedStorageListResultPage { 2050 return DeletedStorageListResultPage{ 2051 fn: getNextPage, 2052 dslr: cur, 2053 } 2054} 2055 2056// EncDataSet ... 2057type EncDataSet struct { 2058 // Data - Array of encrypted security domain 2059 Data *[]EncDataSetItem `json:"data,omitempty"` 2060 // Kdf - The key derivation function used 2061 Kdf *string `json:"kdf,omitempty"` 2062} 2063 2064// EncDataSetItem ... 2065type EncDataSetItem struct { 2066 // CompactJwe - Encrypted data 2067 CompactJwe *string `json:"compact_jwe,omitempty"` 2068 // Tag - hsm backup tag 2069 Tag *string `json:"tag,omitempty"` 2070} 2071 2072// Error the key vault server error. 2073type Error struct { 2074 // Code - READ-ONLY; The error code. 2075 Code *string `json:"code,omitempty"` 2076 // Message - READ-ONLY; The error message. 2077 Message *string `json:"message,omitempty"` 2078 // InnerError - READ-ONLY 2079 InnerError *Error `json:"innererror,omitempty"` 2080} 2081 2082// MarshalJSON is the custom marshaler for Error. 2083func (e Error) MarshalJSON() ([]byte, error) { 2084 objectMap := make(map[string]interface{}) 2085 return json.Marshal(objectMap) 2086} 2087 2088// ErrorType the key vault error exception. 2089type ErrorType struct { 2090 // Error - READ-ONLY 2091 Error *Error `json:"error,omitempty"` 2092} 2093 2094// MarshalJSON is the custom marshaler for ErrorType. 2095func (et ErrorType) MarshalJSON() ([]byte, error) { 2096 objectMap := make(map[string]interface{}) 2097 return json.Marshal(objectMap) 2098} 2099 2100// FullBackupFuture an abstraction for monitoring and retrieving the results of a long-running operation. 2101type FullBackupFuture struct { 2102 azure.FutureAPI 2103 // Result returns the result of the asynchronous operation. 2104 // If the operation has not completed it will return an error. 2105 Result func(BaseClient) (FullBackupOperation, error) 2106} 2107 2108// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2109func (future *FullBackupFuture) UnmarshalJSON(body []byte) error { 2110 var azFuture azure.Future 2111 if err := json.Unmarshal(body, &azFuture); err != nil { 2112 return err 2113 } 2114 future.FutureAPI = &azFuture 2115 future.Result = future.result 2116 return nil 2117} 2118 2119// result is the default implementation for FullBackupFuture.Result. 2120func (future *FullBackupFuture) result(client BaseClient) (fbo FullBackupOperation, err error) { 2121 var done bool 2122 done, err = future.DoneWithContext(context.Background(), client) 2123 if err != nil { 2124 err = autorest.NewErrorWithError(err, "keyvault.FullBackupFuture", "Result", future.Response(), "Polling failure") 2125 return 2126 } 2127 if !done { 2128 fbo.Response.Response = future.Response() 2129 err = azure.NewAsyncOpIncompleteError("keyvault.FullBackupFuture") 2130 return 2131 } 2132 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2133 if fbo.Response.Response, err = future.GetResult(sender); err == nil && fbo.Response.Response.StatusCode != http.StatusNoContent { 2134 fbo, err = client.FullBackupResponder(fbo.Response.Response) 2135 if err != nil { 2136 err = autorest.NewErrorWithError(err, "keyvault.FullBackupFuture", "Result", fbo.Response.Response, "Failure responding to request") 2137 } 2138 } 2139 return 2140} 2141 2142// FullBackupOperation full backup operation 2143type FullBackupOperation struct { 2144 autorest.Response `json:"-"` 2145 // Status - Status of the backup operation. 2146 Status *string `json:"status,omitempty"` 2147 // StatusDetails - The status details of backup operation. 2148 StatusDetails *string `json:"statusDetails,omitempty"` 2149 // Error - Error encountered, if any, during the full backup operation. 2150 Error *Error `json:"error,omitempty"` 2151 // StartTime - The start time of the backup operation in UTC 2152 StartTime *date.UnixTime `json:"startTime,omitempty"` 2153 // EndTime - The end time of the backup operation in UTC 2154 EndTime *date.UnixTime `json:"endTime,omitempty"` 2155 // JobID - Identifier for the full backup operation. 2156 JobID *string `json:"jobId,omitempty"` 2157 // AzureStorageBlobContainerURI - The Azure blob storage container Uri which contains the full backup 2158 AzureStorageBlobContainerURI *string `json:"azureStorageBlobContainerUri,omitempty"` 2159} 2160 2161// FullRestoreOperationFuture an abstraction for monitoring and retrieving the results of a long-running 2162// operation. 2163type FullRestoreOperationFuture struct { 2164 azure.FutureAPI 2165 // Result returns the result of the asynchronous operation. 2166 // If the operation has not completed it will return an error. 2167 Result func(BaseClient) (RestoreOperation, error) 2168} 2169 2170// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2171func (future *FullRestoreOperationFuture) UnmarshalJSON(body []byte) error { 2172 var azFuture azure.Future 2173 if err := json.Unmarshal(body, &azFuture); err != nil { 2174 return err 2175 } 2176 future.FutureAPI = &azFuture 2177 future.Result = future.result 2178 return nil 2179} 2180 2181// result is the default implementation for FullRestoreOperationFuture.Result. 2182func (future *FullRestoreOperationFuture) result(client BaseClient) (ro RestoreOperation, err error) { 2183 var done bool 2184 done, err = future.DoneWithContext(context.Background(), client) 2185 if err != nil { 2186 err = autorest.NewErrorWithError(err, "keyvault.FullRestoreOperationFuture", "Result", future.Response(), "Polling failure") 2187 return 2188 } 2189 if !done { 2190 ro.Response.Response = future.Response() 2191 err = azure.NewAsyncOpIncompleteError("keyvault.FullRestoreOperationFuture") 2192 return 2193 } 2194 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2195 if ro.Response.Response, err = future.GetResult(sender); err == nil && ro.Response.Response.StatusCode != http.StatusNoContent { 2196 ro, err = client.FullRestoreOperationResponder(ro.Response.Response) 2197 if err != nil { 2198 err = autorest.NewErrorWithError(err, "keyvault.FullRestoreOperationFuture", "Result", ro.Response.Response, "Failure responding to request") 2199 } 2200 } 2201 return 2202} 2203 2204// HSMSecurityDomainUploadFuture an abstraction for monitoring and retrieving the results of a long-running 2205// operation. 2206type HSMSecurityDomainUploadFuture struct { 2207 azure.FutureAPI 2208 // Result returns the result of the asynchronous operation. 2209 // If the operation has not completed it will return an error. 2210 Result func(HSMSecurityDomainClient) (SecurityDomainOperationStatus, error) 2211} 2212 2213// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2214func (future *HSMSecurityDomainUploadFuture) UnmarshalJSON(body []byte) error { 2215 var azFuture azure.Future 2216 if err := json.Unmarshal(body, &azFuture); err != nil { 2217 return err 2218 } 2219 future.FutureAPI = &azFuture 2220 future.Result = future.result 2221 return nil 2222} 2223 2224// result is the default implementation for HSMSecurityDomainUploadFuture.Result. 2225func (future *HSMSecurityDomainUploadFuture) result(client HSMSecurityDomainClient) (sdos SecurityDomainOperationStatus, err error) { 2226 var done bool 2227 done, err = future.DoneWithContext(context.Background(), client) 2228 if err != nil { 2229 err = autorest.NewErrorWithError(err, "keyvault.HSMSecurityDomainUploadFuture", "Result", future.Response(), "Polling failure") 2230 return 2231 } 2232 if !done { 2233 sdos.Response.Response = future.Response() 2234 err = azure.NewAsyncOpIncompleteError("keyvault.HSMSecurityDomainUploadFuture") 2235 return 2236 } 2237 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2238 if sdos.Response.Response, err = future.GetResult(sender); err == nil && sdos.Response.Response.StatusCode != http.StatusNoContent { 2239 sdos, err = client.UploadResponder(sdos.Response.Response) 2240 if err != nil { 2241 err = autorest.NewErrorWithError(err, "keyvault.HSMSecurityDomainUploadFuture", "Result", sdos.Response.Response, "Failure responding to request") 2242 } 2243 } 2244 return 2245} 2246 2247// IssuerAttributes the attributes of an issuer managed by the Key Vault service. 2248type IssuerAttributes struct { 2249 // Enabled - Determines whether the issuer is enabled. 2250 Enabled *bool `json:"enabled,omitempty"` 2251 // Created - READ-ONLY; Creation time in UTC. 2252 Created *date.UnixTime `json:"created,omitempty"` 2253 // Updated - READ-ONLY; Last updated time in UTC. 2254 Updated *date.UnixTime `json:"updated,omitempty"` 2255} 2256 2257// MarshalJSON is the custom marshaler for IssuerAttributes. 2258func (ia IssuerAttributes) MarshalJSON() ([]byte, error) { 2259 objectMap := make(map[string]interface{}) 2260 if ia.Enabled != nil { 2261 objectMap["enabled"] = ia.Enabled 2262 } 2263 return json.Marshal(objectMap) 2264} 2265 2266// IssuerBundle the issuer for Key Vault certificate. 2267type IssuerBundle struct { 2268 autorest.Response `json:"-"` 2269 // ID - READ-ONLY; Identifier for the issuer object. 2270 ID *string `json:"id,omitempty"` 2271 // Provider - The issuer provider. 2272 Provider *string `json:"provider,omitempty"` 2273 // Credentials - The credentials to be used for the issuer. 2274 Credentials *IssuerCredentials `json:"credentials,omitempty"` 2275 // OrganizationDetails - Details of the organization as provided to the issuer. 2276 OrganizationDetails *OrganizationDetails `json:"org_details,omitempty"` 2277 // Attributes - Attributes of the issuer object. 2278 Attributes *IssuerAttributes `json:"attributes,omitempty"` 2279} 2280 2281// MarshalJSON is the custom marshaler for IssuerBundle. 2282func (ib IssuerBundle) MarshalJSON() ([]byte, error) { 2283 objectMap := make(map[string]interface{}) 2284 if ib.Provider != nil { 2285 objectMap["provider"] = ib.Provider 2286 } 2287 if ib.Credentials != nil { 2288 objectMap["credentials"] = ib.Credentials 2289 } 2290 if ib.OrganizationDetails != nil { 2291 objectMap["org_details"] = ib.OrganizationDetails 2292 } 2293 if ib.Attributes != nil { 2294 objectMap["attributes"] = ib.Attributes 2295 } 2296 return json.Marshal(objectMap) 2297} 2298 2299// IssuerCredentials the credentials to be used for the certificate issuer. 2300type IssuerCredentials struct { 2301 // AccountID - The user name/account name/account id. 2302 AccountID *string `json:"account_id,omitempty"` 2303 // Password - The password/secret/account key. 2304 Password *string `json:"pwd,omitempty"` 2305} 2306 2307// IssuerParameters parameters for the issuer of the X509 component of a certificate. 2308type IssuerParameters struct { 2309 // Name - Name of the referenced issuer object or reserved names; for example, 'Self' or 'Unknown'. 2310 Name *string `json:"name,omitempty"` 2311 // CertificateType - Certificate type as supported by the provider (optional); for example 'OV-SSL', 'EV-SSL' 2312 CertificateType *string `json:"cty,omitempty"` 2313 // CertificateTransparency - Indicates if the certificates generated under this policy should be published to certificate transparency logs. 2314 CertificateTransparency *bool `json:"cert_transparency,omitempty"` 2315} 2316 2317// JSONWebKey as of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18 2318type JSONWebKey struct { 2319 // Kid - Key identifier. 2320 Kid *string `json:"kid,omitempty"` 2321 // 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', 'OctHSM' 2322 Kty JSONWebKeyType `json:"kty,omitempty"` 2323 KeyOps *[]string `json:"key_ops,omitempty"` 2324 // N - RSA modulus. (a URL-encoded base64 string) 2325 N *string `json:"n,omitempty"` 2326 // E - RSA public exponent. (a URL-encoded base64 string) 2327 E *string `json:"e,omitempty"` 2328 // D - RSA private exponent, or the D component of an EC private key. (a URL-encoded base64 string) 2329 D *string `json:"d,omitempty"` 2330 // DP - RSA private key parameter. (a URL-encoded base64 string) 2331 DP *string `json:"dp,omitempty"` 2332 // DQ - RSA private key parameter. (a URL-encoded base64 string) 2333 DQ *string `json:"dq,omitempty"` 2334 // QI - RSA private key parameter. (a URL-encoded base64 string) 2335 QI *string `json:"qi,omitempty"` 2336 // P - RSA secret prime. (a URL-encoded base64 string) 2337 P *string `json:"p,omitempty"` 2338 // Q - RSA secret prime, with p < q. (a URL-encoded base64 string) 2339 Q *string `json:"q,omitempty"` 2340 // K - Symmetric key. (a URL-encoded base64 string) 2341 K *string `json:"k,omitempty"` 2342 // T - Protected Key, used with 'Bring Your Own Key'. (a URL-encoded base64 string) 2343 T *string `json:"key_hsm,omitempty"` 2344 // Crv - Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P256', 'P384', 'P521', 'P256K' 2345 Crv JSONWebKeyCurveName `json:"crv,omitempty"` 2346 // X - X component of an EC public key. (a URL-encoded base64 string) 2347 X *string `json:"x,omitempty"` 2348 // Y - Y component of an EC public key. (a URL-encoded base64 string) 2349 Y *string `json:"y,omitempty"` 2350} 2351 2352// Key ... 2353type Key struct { 2354 // EncKey - Compact JWE wrapped share 2355 EncKey *string `json:"enc_key,omitempty"` 2356 // X5t256 - SHA 256 hash of certificate 2357 X5t256 *string `json:"x5t_256,omitempty"` 2358} 2359 2360// KeyAttributes the attributes of a key managed by the key vault service. 2361type KeyAttributes struct { 2362 // RecoverableDays - READ-ONLY; softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0. 2363 RecoverableDays *int32 `json:"recoverableDays,omitempty"` 2364 // RecoveryLevel - READ-ONLY; 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', 'CustomizedRecoverablePurgeable', 'CustomizedRecoverable', 'CustomizedRecoverableProtectedSubscription' 2365 RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` 2366 // Exportable - Indicates if the private key can be exported. 2367 Exportable *bool `json:"exportable,omitempty"` 2368 // Enabled - Determines whether the object is enabled. 2369 Enabled *bool `json:"enabled,omitempty"` 2370 // NotBefore - Not before date in UTC. 2371 NotBefore *date.UnixTime `json:"nbf,omitempty"` 2372 // Expires - Expiry date in UTC. 2373 Expires *date.UnixTime `json:"exp,omitempty"` 2374 // Created - READ-ONLY; Creation time in UTC. 2375 Created *date.UnixTime `json:"created,omitempty"` 2376 // Updated - READ-ONLY; Last updated time in UTC. 2377 Updated *date.UnixTime `json:"updated,omitempty"` 2378} 2379 2380// MarshalJSON is the custom marshaler for KeyAttributes. 2381func (ka KeyAttributes) MarshalJSON() ([]byte, error) { 2382 objectMap := make(map[string]interface{}) 2383 if ka.Exportable != nil { 2384 objectMap["exportable"] = ka.Exportable 2385 } 2386 if ka.Enabled != nil { 2387 objectMap["enabled"] = ka.Enabled 2388 } 2389 if ka.NotBefore != nil { 2390 objectMap["nbf"] = ka.NotBefore 2391 } 2392 if ka.Expires != nil { 2393 objectMap["exp"] = ka.Expires 2394 } 2395 return json.Marshal(objectMap) 2396} 2397 2398// KeyBundle a KeyBundle consisting of a WebKey plus its attributes. 2399type KeyBundle struct { 2400 autorest.Response `json:"-"` 2401 // Key - The Json web key. 2402 Key *JSONWebKey `json:"key,omitempty"` 2403 // Attributes - The key management attributes. 2404 Attributes *KeyAttributes `json:"attributes,omitempty"` 2405 // Tags - Application specific metadata in the form of key-value pairs. 2406 Tags map[string]*string `json:"tags"` 2407 // Managed - READ-ONLY; True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. 2408 Managed *bool `json:"managed,omitempty"` 2409 // ReleasePolicy - The policy rules under which the key can be exported. 2410 ReleasePolicy *KeyReleasePolicy `json:"release_policy,omitempty"` 2411} 2412 2413// MarshalJSON is the custom marshaler for KeyBundle. 2414func (kb KeyBundle) MarshalJSON() ([]byte, error) { 2415 objectMap := make(map[string]interface{}) 2416 if kb.Key != nil { 2417 objectMap["key"] = kb.Key 2418 } 2419 if kb.Attributes != nil { 2420 objectMap["attributes"] = kb.Attributes 2421 } 2422 if kb.Tags != nil { 2423 objectMap["tags"] = kb.Tags 2424 } 2425 if kb.ReleasePolicy != nil { 2426 objectMap["release_policy"] = kb.ReleasePolicy 2427 } 2428 return json.Marshal(objectMap) 2429} 2430 2431// KeyCreateParameters the key create parameters. 2432type KeyCreateParameters struct { 2433 // Kty - The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'ECHSM', 'RSA', 'RSAHSM', 'Oct', 'OctHSM' 2434 Kty JSONWebKeyType `json:"kty,omitempty"` 2435 // KeySize - The key size in bits. For example: 2048, 3072, or 4096 for RSA. 2436 KeySize *int32 `json:"key_size,omitempty"` 2437 // PublicExponent - The public exponent for a RSA key. 2438 PublicExponent *int32 `json:"public_exponent,omitempty"` 2439 KeyOps *[]JSONWebKeyOperation `json:"key_ops,omitempty"` 2440 KeyAttributes *KeyAttributes `json:"attributes,omitempty"` 2441 // Tags - Application specific metadata in the form of key-value pairs. 2442 Tags map[string]*string `json:"tags"` 2443 // Curve - Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P256', 'P384', 'P521', 'P256K' 2444 Curve JSONWebKeyCurveName `json:"crv,omitempty"` 2445 // ReleasePolicy - The policy rules under which the key can be exported. 2446 ReleasePolicy *KeyReleasePolicy `json:"release_policy,omitempty"` 2447} 2448 2449// MarshalJSON is the custom marshaler for KeyCreateParameters. 2450func (kcp KeyCreateParameters) MarshalJSON() ([]byte, error) { 2451 objectMap := make(map[string]interface{}) 2452 if kcp.Kty != "" { 2453 objectMap["kty"] = kcp.Kty 2454 } 2455 if kcp.KeySize != nil { 2456 objectMap["key_size"] = kcp.KeySize 2457 } 2458 if kcp.PublicExponent != nil { 2459 objectMap["public_exponent"] = kcp.PublicExponent 2460 } 2461 if kcp.KeyOps != nil { 2462 objectMap["key_ops"] = kcp.KeyOps 2463 } 2464 if kcp.KeyAttributes != nil { 2465 objectMap["attributes"] = kcp.KeyAttributes 2466 } 2467 if kcp.Tags != nil { 2468 objectMap["tags"] = kcp.Tags 2469 } 2470 if kcp.Curve != "" { 2471 objectMap["crv"] = kcp.Curve 2472 } 2473 if kcp.ReleasePolicy != nil { 2474 objectMap["release_policy"] = kcp.ReleasePolicy 2475 } 2476 return json.Marshal(objectMap) 2477} 2478 2479// KeyExportParameters the export key parameters. 2480type KeyExportParameters struct { 2481 // Environment - The target environment assertion. 2482 Environment *string `json:"env,omitempty"` 2483} 2484 2485// KeyImportParameters the key import parameters. 2486type KeyImportParameters struct { 2487 // Hsm - Whether to import as a hardware key (HSM) or software key. 2488 Hsm *bool `json:"Hsm,omitempty"` 2489 // Key - The Json web key 2490 Key *JSONWebKey `json:"key,omitempty"` 2491 // KeyAttributes - The key management attributes. 2492 KeyAttributes *KeyAttributes `json:"attributes,omitempty"` 2493 // Tags - Application specific metadata in the form of key-value pairs. 2494 Tags map[string]*string `json:"tags"` 2495 // ReleasePolicy - The policy rules under which the key can be exported. 2496 ReleasePolicy *KeyReleasePolicy `json:"release_policy,omitempty"` 2497} 2498 2499// MarshalJSON is the custom marshaler for KeyImportParameters. 2500func (kip KeyImportParameters) MarshalJSON() ([]byte, error) { 2501 objectMap := make(map[string]interface{}) 2502 if kip.Hsm != nil { 2503 objectMap["Hsm"] = kip.Hsm 2504 } 2505 if kip.Key != nil { 2506 objectMap["key"] = kip.Key 2507 } 2508 if kip.KeyAttributes != nil { 2509 objectMap["attributes"] = kip.KeyAttributes 2510 } 2511 if kip.Tags != nil { 2512 objectMap["tags"] = kip.Tags 2513 } 2514 if kip.ReleasePolicy != nil { 2515 objectMap["release_policy"] = kip.ReleasePolicy 2516 } 2517 return json.Marshal(objectMap) 2518} 2519 2520// KeyItem the key item containing key metadata. 2521type KeyItem struct { 2522 // Kid - Key identifier. 2523 Kid *string `json:"kid,omitempty"` 2524 // Attributes - The key management attributes. 2525 Attributes *KeyAttributes `json:"attributes,omitempty"` 2526 // Tags - Application specific metadata in the form of key-value pairs. 2527 Tags map[string]*string `json:"tags"` 2528 // Managed - READ-ONLY; True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. 2529 Managed *bool `json:"managed,omitempty"` 2530} 2531 2532// MarshalJSON is the custom marshaler for KeyItem. 2533func (ki KeyItem) MarshalJSON() ([]byte, error) { 2534 objectMap := make(map[string]interface{}) 2535 if ki.Kid != nil { 2536 objectMap["kid"] = ki.Kid 2537 } 2538 if ki.Attributes != nil { 2539 objectMap["attributes"] = ki.Attributes 2540 } 2541 if ki.Tags != nil { 2542 objectMap["tags"] = ki.Tags 2543 } 2544 return json.Marshal(objectMap) 2545} 2546 2547// KeyListResult the key list result. 2548type KeyListResult struct { 2549 autorest.Response `json:"-"` 2550 // Value - READ-ONLY; A response message containing a list of keys in the key vault along with a link to the next page of keys. 2551 Value *[]KeyItem `json:"value,omitempty"` 2552 // NextLink - READ-ONLY; The URL to get the next set of keys. 2553 NextLink *string `json:"nextLink,omitempty"` 2554} 2555 2556// MarshalJSON is the custom marshaler for KeyListResult. 2557func (klr KeyListResult) MarshalJSON() ([]byte, error) { 2558 objectMap := make(map[string]interface{}) 2559 return json.Marshal(objectMap) 2560} 2561 2562// KeyListResultIterator provides access to a complete listing of KeyItem values. 2563type KeyListResultIterator struct { 2564 i int 2565 page KeyListResultPage 2566} 2567 2568// NextWithContext advances to the next value. If there was an error making 2569// the request the iterator does not advance and the error is returned. 2570func (iter *KeyListResultIterator) NextWithContext(ctx context.Context) (err error) { 2571 if tracing.IsEnabled() { 2572 ctx = tracing.StartSpan(ctx, fqdn+"/KeyListResultIterator.NextWithContext") 2573 defer func() { 2574 sc := -1 2575 if iter.Response().Response.Response != nil { 2576 sc = iter.Response().Response.Response.StatusCode 2577 } 2578 tracing.EndSpan(ctx, sc, err) 2579 }() 2580 } 2581 iter.i++ 2582 if iter.i < len(iter.page.Values()) { 2583 return nil 2584 } 2585 err = iter.page.NextWithContext(ctx) 2586 if err != nil { 2587 iter.i-- 2588 return err 2589 } 2590 iter.i = 0 2591 return nil 2592} 2593 2594// Next advances to the next value. If there was an error making 2595// the request the iterator does not advance and the error is returned. 2596// Deprecated: Use NextWithContext() instead. 2597func (iter *KeyListResultIterator) Next() error { 2598 return iter.NextWithContext(context.Background()) 2599} 2600 2601// NotDone returns true if the enumeration should be started or is not yet complete. 2602func (iter KeyListResultIterator) NotDone() bool { 2603 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2604} 2605 2606// Response returns the raw server response from the last page request. 2607func (iter KeyListResultIterator) Response() KeyListResult { 2608 return iter.page.Response() 2609} 2610 2611// Value returns the current value or a zero-initialized value if the 2612// iterator has advanced beyond the end of the collection. 2613func (iter KeyListResultIterator) Value() KeyItem { 2614 if !iter.page.NotDone() { 2615 return KeyItem{} 2616 } 2617 return iter.page.Values()[iter.i] 2618} 2619 2620// Creates a new instance of the KeyListResultIterator type. 2621func NewKeyListResultIterator(page KeyListResultPage) KeyListResultIterator { 2622 return KeyListResultIterator{page: page} 2623} 2624 2625// IsEmpty returns true if the ListResult contains no values. 2626func (klr KeyListResult) IsEmpty() bool { 2627 return klr.Value == nil || len(*klr.Value) == 0 2628} 2629 2630// hasNextLink returns true if the NextLink is not empty. 2631func (klr KeyListResult) hasNextLink() bool { 2632 return klr.NextLink != nil && len(*klr.NextLink) != 0 2633} 2634 2635// keyListResultPreparer prepares a request to retrieve the next set of results. 2636// It returns nil if no more results exist. 2637func (klr KeyListResult) keyListResultPreparer(ctx context.Context) (*http.Request, error) { 2638 if !klr.hasNextLink() { 2639 return nil, nil 2640 } 2641 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2642 autorest.AsJSON(), 2643 autorest.AsGet(), 2644 autorest.WithBaseURL(to.String(klr.NextLink))) 2645} 2646 2647// KeyListResultPage contains a page of KeyItem values. 2648type KeyListResultPage struct { 2649 fn func(context.Context, KeyListResult) (KeyListResult, error) 2650 klr KeyListResult 2651} 2652 2653// NextWithContext advances to the next page of values. If there was an error making 2654// the request the page does not advance and the error is returned. 2655func (page *KeyListResultPage) NextWithContext(ctx context.Context) (err error) { 2656 if tracing.IsEnabled() { 2657 ctx = tracing.StartSpan(ctx, fqdn+"/KeyListResultPage.NextWithContext") 2658 defer func() { 2659 sc := -1 2660 if page.Response().Response.Response != nil { 2661 sc = page.Response().Response.Response.StatusCode 2662 } 2663 tracing.EndSpan(ctx, sc, err) 2664 }() 2665 } 2666 for { 2667 next, err := page.fn(ctx, page.klr) 2668 if err != nil { 2669 return err 2670 } 2671 page.klr = next 2672 if !next.hasNextLink() || !next.IsEmpty() { 2673 break 2674 } 2675 } 2676 return nil 2677} 2678 2679// Next advances to the next page of values. If there was an error making 2680// the request the page does not advance and the error is returned. 2681// Deprecated: Use NextWithContext() instead. 2682func (page *KeyListResultPage) Next() error { 2683 return page.NextWithContext(context.Background()) 2684} 2685 2686// NotDone returns true if the page enumeration should be started or is not yet complete. 2687func (page KeyListResultPage) NotDone() bool { 2688 return !page.klr.IsEmpty() 2689} 2690 2691// Response returns the raw server response from the last page request. 2692func (page KeyListResultPage) Response() KeyListResult { 2693 return page.klr 2694} 2695 2696// Values returns the slice of values for the current page or nil if there are no values. 2697func (page KeyListResultPage) Values() []KeyItem { 2698 if page.klr.IsEmpty() { 2699 return nil 2700 } 2701 return *page.klr.Value 2702} 2703 2704// Creates a new instance of the KeyListResultPage type. 2705func NewKeyListResultPage(cur KeyListResult, getNextPage func(context.Context, KeyListResult) (KeyListResult, error)) KeyListResultPage { 2706 return KeyListResultPage{ 2707 fn: getNextPage, 2708 klr: cur, 2709 } 2710} 2711 2712// KeyOperationResult the key operation result. 2713type KeyOperationResult struct { 2714 autorest.Response `json:"-"` 2715 // Kid - READ-ONLY; Key identifier 2716 Kid *string `json:"kid,omitempty"` 2717 // Result - READ-ONLY; a URL-encoded base64 string 2718 Result *string `json:"value,omitempty"` 2719} 2720 2721// MarshalJSON is the custom marshaler for KeyOperationResult. 2722func (kor KeyOperationResult) MarshalJSON() ([]byte, error) { 2723 objectMap := make(map[string]interface{}) 2724 return json.Marshal(objectMap) 2725} 2726 2727// KeyOperationsParameters the key operations parameters. 2728type KeyOperationsParameters struct { 2729 // Algorithm - algorithm identifier. Possible values include: 'RSAOAEP', 'RSAOAEP256', 'RSA15', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' 2730 Algorithm JSONWebKeyEncryptionAlgorithm `json:"alg,omitempty"` 2731 // Value - a URL-encoded base64 string 2732 Value *string `json:"value,omitempty"` 2733 // Iv - Initialization vector for symmetric algorithms. (a URL-encoded base64 string) 2734 Iv *string `json:"iv,omitempty"` 2735 // Aad - Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. (a URL-encoded base64 string) 2736 Aad *string `json:"aad,omitempty"` 2737 // Tag - The tag to authenticate when performing decryption with an authenticated algorithm. (a URL-encoded base64 string) 2738 Tag *string `json:"tag,omitempty"` 2739} 2740 2741// KeyProperties properties of the key pair backing a certificate. 2742type KeyProperties struct { 2743 // Exportable - Indicates if the private key can be exported. 2744 Exportable *bool `json:"exportable,omitempty"` 2745 // KeyType - The type of key pair to be used for the certificate. Possible values include: 'EC', 'ECHSM', 'RSA', 'RSAHSM', 'Oct', 'OctHSM' 2746 KeyType JSONWebKeyType `json:"kty,omitempty"` 2747 // KeySize - The key size in bits. For example: 2048, 3072, or 4096 for RSA. 2748 KeySize *int32 `json:"key_size,omitempty"` 2749 // ReuseKey - Indicates if the same key pair will be used on certificate renewal. 2750 ReuseKey *bool `json:"reuse_key,omitempty"` 2751 // Curve - Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P256', 'P384', 'P521', 'P256K' 2752 Curve JSONWebKeyCurveName `json:"crv,omitempty"` 2753} 2754 2755// KeyReleasePolicy ... 2756type KeyReleasePolicy struct { 2757 // ContentType - Content type and version of key release policy 2758 ContentType *string `json:"contentType,omitempty"` 2759 // Data - Blob encoding the policy rules under which the key can be exported. (a URL-encoded base64 string) 2760 Data *string `json:"data,omitempty"` 2761} 2762 2763// KeyRestoreParameters the key restore parameters. 2764type KeyRestoreParameters struct { 2765 // KeyBundleBackup - The backup blob associated with a key bundle. (a URL-encoded base64 string) 2766 KeyBundleBackup *string `json:"value,omitempty"` 2767} 2768 2769// KeySignParameters the key operations parameters. 2770type KeySignParameters struct { 2771 // 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' 2772 Algorithm JSONWebKeySignatureAlgorithm `json:"alg,omitempty"` 2773 // Value - a URL-encoded base64 string 2774 Value *string `json:"value,omitempty"` 2775} 2776 2777// KeyUpdateParameters the key update parameters. 2778type KeyUpdateParameters struct { 2779 // KeyOps - Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. 2780 KeyOps *[]JSONWebKeyOperation `json:"key_ops,omitempty"` 2781 KeyAttributes *KeyAttributes `json:"attributes,omitempty"` 2782 // Tags - Application specific metadata in the form of key-value pairs. 2783 Tags map[string]*string `json:"tags"` 2784 // ReleasePolicy - The policy rules under which the key can be exported. 2785 ReleasePolicy *KeyReleasePolicy `json:"release_policy,omitempty"` 2786} 2787 2788// MarshalJSON is the custom marshaler for KeyUpdateParameters. 2789func (kup KeyUpdateParameters) MarshalJSON() ([]byte, error) { 2790 objectMap := make(map[string]interface{}) 2791 if kup.KeyOps != nil { 2792 objectMap["key_ops"] = kup.KeyOps 2793 } 2794 if kup.KeyAttributes != nil { 2795 objectMap["attributes"] = kup.KeyAttributes 2796 } 2797 if kup.Tags != nil { 2798 objectMap["tags"] = kup.Tags 2799 } 2800 if kup.ReleasePolicy != nil { 2801 objectMap["release_policy"] = kup.ReleasePolicy 2802 } 2803 return json.Marshal(objectMap) 2804} 2805 2806// KeyVerifyParameters the key verify parameters. 2807type KeyVerifyParameters struct { 2808 // 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' 2809 Algorithm JSONWebKeySignatureAlgorithm `json:"alg,omitempty"` 2810 // Digest - The digest used for signing. (a URL-encoded base64 string) 2811 Digest *string `json:"digest,omitempty"` 2812 // Signature - The signature to be verified. (a URL-encoded base64 string) 2813 Signature *string `json:"value,omitempty"` 2814} 2815 2816// KeyVerifyResult the key verify result. 2817type KeyVerifyResult struct { 2818 autorest.Response `json:"-"` 2819 // Value - READ-ONLY; True if the signature is verified, otherwise false. 2820 Value *bool `json:"value,omitempty"` 2821} 2822 2823// MarshalJSON is the custom marshaler for KeyVerifyResult. 2824func (kvr KeyVerifyResult) MarshalJSON() ([]byte, error) { 2825 objectMap := make(map[string]interface{}) 2826 return json.Marshal(objectMap) 2827} 2828 2829// LifetimeAction action and its trigger that will be performed by Key Vault over the lifetime of a 2830// certificate. 2831type LifetimeAction struct { 2832 // Trigger - The condition that will execute the action. 2833 Trigger *Trigger `json:"trigger,omitempty"` 2834 // Action - The action that will be executed. 2835 Action *Action `json:"action,omitempty"` 2836} 2837 2838// OrganizationDetails details of the organization of the certificate issuer. 2839type OrganizationDetails struct { 2840 // ID - Id of the organization. 2841 ID *string `json:"id,omitempty"` 2842 // AdminDetails - Details of the organization administrator. 2843 AdminDetails *[]AdministratorDetails `json:"admin_details,omitempty"` 2844} 2845 2846// PendingCertificateSigningRequestResult the pending certificate signing request result. 2847type PendingCertificateSigningRequestResult struct { 2848 // Value - READ-ONLY; The pending certificate signing request as Base64 encoded string. 2849 Value *string `json:"value,omitempty"` 2850} 2851 2852// MarshalJSON is the custom marshaler for PendingCertificateSigningRequestResult. 2853func (pcsrr PendingCertificateSigningRequestResult) MarshalJSON() ([]byte, error) { 2854 objectMap := make(map[string]interface{}) 2855 return json.Marshal(objectMap) 2856} 2857 2858// Permission role definition permissions. 2859type Permission struct { 2860 // Actions - Allowed actions. 2861 Actions *[]string `json:"actions,omitempty"` 2862 // NotActions - Denied actions. 2863 NotActions *[]string `json:"notActions,omitempty"` 2864 // DataActions - Allowed Data actions. 2865 DataActions *[]string `json:"dataActions,omitempty"` 2866 // NotDataActions - Denied Data actions. 2867 NotDataActions *[]string `json:"notDataActions,omitempty"` 2868} 2869 2870// RestoreOperation restore operation 2871type RestoreOperation struct { 2872 autorest.Response `json:"-"` 2873 // Status - Status of the restore operation. 2874 Status *string `json:"status,omitempty"` 2875 // StatusDetails - The status details of restore operation. 2876 StatusDetails *string `json:"statusDetails,omitempty"` 2877 // Error - Error encountered, if any, during the restore operation. 2878 Error *Error `json:"error,omitempty"` 2879 // JobID - Identifier for the restore operation. 2880 JobID *string `json:"jobId,omitempty"` 2881 // StartTime - The start time of the restore operation 2882 StartTime *date.UnixTime `json:"startTime,omitempty"` 2883 // EndTime - The end time of the restore operation 2884 EndTime *date.UnixTime `json:"endTime,omitempty"` 2885} 2886 2887// RestoreOperationParameters ... 2888type RestoreOperationParameters struct { 2889 SasTokenParameters *SASTokenParameter `json:"sasTokenParameters,omitempty"` 2890 // FolderToRestore - The Folder name of the blob where the previous successful full backup was stored 2891 FolderToRestore *string `json:"folderToRestore,omitempty"` 2892} 2893 2894// RoleAssignment role Assignments 2895type RoleAssignment struct { 2896 autorest.Response `json:"-"` 2897 // ID - READ-ONLY; The role assignment ID. 2898 ID *string `json:"id,omitempty"` 2899 // Name - READ-ONLY; The role assignment name. 2900 Name *string `json:"name,omitempty"` 2901 // Type - READ-ONLY; The role assignment type. 2902 Type *string `json:"type,omitempty"` 2903 // Properties - Role assignment properties. 2904 Properties *RoleAssignmentPropertiesWithScope `json:"properties,omitempty"` 2905} 2906 2907// MarshalJSON is the custom marshaler for RoleAssignment. 2908func (ra RoleAssignment) MarshalJSON() ([]byte, error) { 2909 objectMap := make(map[string]interface{}) 2910 if ra.Properties != nil { 2911 objectMap["properties"] = ra.Properties 2912 } 2913 return json.Marshal(objectMap) 2914} 2915 2916// RoleAssignmentCreateParameters role assignment create parameters. 2917type RoleAssignmentCreateParameters struct { 2918 // Properties - Role assignment properties. 2919 Properties *RoleAssignmentProperties `json:"properties,omitempty"` 2920} 2921 2922// RoleAssignmentFilter role Assignments filter 2923type RoleAssignmentFilter struct { 2924 // PrincipalID - Returns role assignment of the specific principal. 2925 PrincipalID *string `json:"principalId,omitempty"` 2926} 2927 2928// RoleAssignmentListResult role assignment list operation result. 2929type RoleAssignmentListResult struct { 2930 autorest.Response `json:"-"` 2931 // Value - Role assignment list. 2932 Value *[]RoleAssignment `json:"value,omitempty"` 2933 // NextLink - The URL to use for getting the next set of results. 2934 NextLink *string `json:"nextLink,omitempty"` 2935} 2936 2937// RoleAssignmentListResultIterator provides access to a complete listing of RoleAssignment values. 2938type RoleAssignmentListResultIterator struct { 2939 i int 2940 page RoleAssignmentListResultPage 2941} 2942 2943// NextWithContext advances to the next value. If there was an error making 2944// the request the iterator does not advance and the error is returned. 2945func (iter *RoleAssignmentListResultIterator) NextWithContext(ctx context.Context) (err error) { 2946 if tracing.IsEnabled() { 2947 ctx = tracing.StartSpan(ctx, fqdn+"/RoleAssignmentListResultIterator.NextWithContext") 2948 defer func() { 2949 sc := -1 2950 if iter.Response().Response.Response != nil { 2951 sc = iter.Response().Response.Response.StatusCode 2952 } 2953 tracing.EndSpan(ctx, sc, err) 2954 }() 2955 } 2956 iter.i++ 2957 if iter.i < len(iter.page.Values()) { 2958 return nil 2959 } 2960 err = iter.page.NextWithContext(ctx) 2961 if err != nil { 2962 iter.i-- 2963 return err 2964 } 2965 iter.i = 0 2966 return nil 2967} 2968 2969// Next advances to the next value. If there was an error making 2970// the request the iterator does not advance and the error is returned. 2971// Deprecated: Use NextWithContext() instead. 2972func (iter *RoleAssignmentListResultIterator) Next() error { 2973 return iter.NextWithContext(context.Background()) 2974} 2975 2976// NotDone returns true if the enumeration should be started or is not yet complete. 2977func (iter RoleAssignmentListResultIterator) NotDone() bool { 2978 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2979} 2980 2981// Response returns the raw server response from the last page request. 2982func (iter RoleAssignmentListResultIterator) Response() RoleAssignmentListResult { 2983 return iter.page.Response() 2984} 2985 2986// Value returns the current value or a zero-initialized value if the 2987// iterator has advanced beyond the end of the collection. 2988func (iter RoleAssignmentListResultIterator) Value() RoleAssignment { 2989 if !iter.page.NotDone() { 2990 return RoleAssignment{} 2991 } 2992 return iter.page.Values()[iter.i] 2993} 2994 2995// Creates a new instance of the RoleAssignmentListResultIterator type. 2996func NewRoleAssignmentListResultIterator(page RoleAssignmentListResultPage) RoleAssignmentListResultIterator { 2997 return RoleAssignmentListResultIterator{page: page} 2998} 2999 3000// IsEmpty returns true if the ListResult contains no values. 3001func (ralr RoleAssignmentListResult) IsEmpty() bool { 3002 return ralr.Value == nil || len(*ralr.Value) == 0 3003} 3004 3005// hasNextLink returns true if the NextLink is not empty. 3006func (ralr RoleAssignmentListResult) hasNextLink() bool { 3007 return ralr.NextLink != nil && len(*ralr.NextLink) != 0 3008} 3009 3010// roleAssignmentListResultPreparer prepares a request to retrieve the next set of results. 3011// It returns nil if no more results exist. 3012func (ralr RoleAssignmentListResult) roleAssignmentListResultPreparer(ctx context.Context) (*http.Request, error) { 3013 if !ralr.hasNextLink() { 3014 return nil, nil 3015 } 3016 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3017 autorest.AsJSON(), 3018 autorest.AsGet(), 3019 autorest.WithBaseURL(to.String(ralr.NextLink))) 3020} 3021 3022// RoleAssignmentListResultPage contains a page of RoleAssignment values. 3023type RoleAssignmentListResultPage struct { 3024 fn func(context.Context, RoleAssignmentListResult) (RoleAssignmentListResult, error) 3025 ralr RoleAssignmentListResult 3026} 3027 3028// NextWithContext advances to the next page of values. If there was an error making 3029// the request the page does not advance and the error is returned. 3030func (page *RoleAssignmentListResultPage) NextWithContext(ctx context.Context) (err error) { 3031 if tracing.IsEnabled() { 3032 ctx = tracing.StartSpan(ctx, fqdn+"/RoleAssignmentListResultPage.NextWithContext") 3033 defer func() { 3034 sc := -1 3035 if page.Response().Response.Response != nil { 3036 sc = page.Response().Response.Response.StatusCode 3037 } 3038 tracing.EndSpan(ctx, sc, err) 3039 }() 3040 } 3041 for { 3042 next, err := page.fn(ctx, page.ralr) 3043 if err != nil { 3044 return err 3045 } 3046 page.ralr = next 3047 if !next.hasNextLink() || !next.IsEmpty() { 3048 break 3049 } 3050 } 3051 return nil 3052} 3053 3054// Next advances to the next page of values. If there was an error making 3055// the request the page does not advance and the error is returned. 3056// Deprecated: Use NextWithContext() instead. 3057func (page *RoleAssignmentListResultPage) Next() error { 3058 return page.NextWithContext(context.Background()) 3059} 3060 3061// NotDone returns true if the page enumeration should be started or is not yet complete. 3062func (page RoleAssignmentListResultPage) NotDone() bool { 3063 return !page.ralr.IsEmpty() 3064} 3065 3066// Response returns the raw server response from the last page request. 3067func (page RoleAssignmentListResultPage) Response() RoleAssignmentListResult { 3068 return page.ralr 3069} 3070 3071// Values returns the slice of values for the current page or nil if there are no values. 3072func (page RoleAssignmentListResultPage) Values() []RoleAssignment { 3073 if page.ralr.IsEmpty() { 3074 return nil 3075 } 3076 return *page.ralr.Value 3077} 3078 3079// Creates a new instance of the RoleAssignmentListResultPage type. 3080func NewRoleAssignmentListResultPage(cur RoleAssignmentListResult, getNextPage func(context.Context, RoleAssignmentListResult) (RoleAssignmentListResult, error)) RoleAssignmentListResultPage { 3081 return RoleAssignmentListResultPage{ 3082 fn: getNextPage, 3083 ralr: cur, 3084 } 3085} 3086 3087// RoleAssignmentProperties role assignment properties. 3088type RoleAssignmentProperties struct { 3089 // RoleDefinitionID - The role definition ID used in the role assignment. 3090 RoleDefinitionID *string `json:"roleDefinitionId,omitempty"` 3091 // PrincipalID - The principal ID assigned to the role. This maps to the ID inside the Active Directory. It can point to a user, service principal, or security group. 3092 PrincipalID *string `json:"principalId,omitempty"` 3093} 3094 3095// RoleAssignmentPropertiesWithScope role assignment properties with scope. 3096type RoleAssignmentPropertiesWithScope struct { 3097 // Scope - The role assignment scope. 3098 Scope *string `json:"scope,omitempty"` 3099 // RoleDefinitionID - The role definition ID. 3100 RoleDefinitionID *string `json:"roleDefinitionId,omitempty"` 3101 // PrincipalID - The principal ID. 3102 PrincipalID *string `json:"principalId,omitempty"` 3103} 3104 3105// RoleDefinition role definition. 3106type RoleDefinition struct { 3107 // ID - READ-ONLY; The role definition ID. 3108 ID *string `json:"id,omitempty"` 3109 // Name - READ-ONLY; The role definition name. 3110 Name *string `json:"name,omitempty"` 3111 // Type - READ-ONLY; The role definition type. 3112 Type *string `json:"type,omitempty"` 3113 // RoleDefinitionProperties - Role definition properties. 3114 *RoleDefinitionProperties `json:"properties,omitempty"` 3115} 3116 3117// MarshalJSON is the custom marshaler for RoleDefinition. 3118func (rd RoleDefinition) MarshalJSON() ([]byte, error) { 3119 objectMap := make(map[string]interface{}) 3120 if rd.RoleDefinitionProperties != nil { 3121 objectMap["properties"] = rd.RoleDefinitionProperties 3122 } 3123 return json.Marshal(objectMap) 3124} 3125 3126// UnmarshalJSON is the custom unmarshaler for RoleDefinition struct. 3127func (rd *RoleDefinition) UnmarshalJSON(body []byte) error { 3128 var m map[string]*json.RawMessage 3129 err := json.Unmarshal(body, &m) 3130 if err != nil { 3131 return err 3132 } 3133 for k, v := range m { 3134 switch k { 3135 case "id": 3136 if v != nil { 3137 var ID string 3138 err = json.Unmarshal(*v, &ID) 3139 if err != nil { 3140 return err 3141 } 3142 rd.ID = &ID 3143 } 3144 case "name": 3145 if v != nil { 3146 var name string 3147 err = json.Unmarshal(*v, &name) 3148 if err != nil { 3149 return err 3150 } 3151 rd.Name = &name 3152 } 3153 case "type": 3154 if v != nil { 3155 var typeVar string 3156 err = json.Unmarshal(*v, &typeVar) 3157 if err != nil { 3158 return err 3159 } 3160 rd.Type = &typeVar 3161 } 3162 case "properties": 3163 if v != nil { 3164 var roleDefinitionProperties RoleDefinitionProperties 3165 err = json.Unmarshal(*v, &roleDefinitionProperties) 3166 if err != nil { 3167 return err 3168 } 3169 rd.RoleDefinitionProperties = &roleDefinitionProperties 3170 } 3171 } 3172 } 3173 3174 return nil 3175} 3176 3177// RoleDefinitionFilter role Definitions filter 3178type RoleDefinitionFilter struct { 3179 // RoleName - Returns role definition with the specific name. 3180 RoleName *string `json:"roleName,omitempty"` 3181} 3182 3183// RoleDefinitionListResult role definition list operation result. 3184type RoleDefinitionListResult struct { 3185 autorest.Response `json:"-"` 3186 // Value - Role definition list. 3187 Value *[]RoleDefinition `json:"value,omitempty"` 3188 // NextLink - The URL to use for getting the next set of results. 3189 NextLink *string `json:"nextLink,omitempty"` 3190} 3191 3192// RoleDefinitionListResultIterator provides access to a complete listing of RoleDefinition values. 3193type RoleDefinitionListResultIterator struct { 3194 i int 3195 page RoleDefinitionListResultPage 3196} 3197 3198// NextWithContext advances to the next value. If there was an error making 3199// the request the iterator does not advance and the error is returned. 3200func (iter *RoleDefinitionListResultIterator) NextWithContext(ctx context.Context) (err error) { 3201 if tracing.IsEnabled() { 3202 ctx = tracing.StartSpan(ctx, fqdn+"/RoleDefinitionListResultIterator.NextWithContext") 3203 defer func() { 3204 sc := -1 3205 if iter.Response().Response.Response != nil { 3206 sc = iter.Response().Response.Response.StatusCode 3207 } 3208 tracing.EndSpan(ctx, sc, err) 3209 }() 3210 } 3211 iter.i++ 3212 if iter.i < len(iter.page.Values()) { 3213 return nil 3214 } 3215 err = iter.page.NextWithContext(ctx) 3216 if err != nil { 3217 iter.i-- 3218 return err 3219 } 3220 iter.i = 0 3221 return nil 3222} 3223 3224// Next advances to the next value. If there was an error making 3225// the request the iterator does not advance and the error is returned. 3226// Deprecated: Use NextWithContext() instead. 3227func (iter *RoleDefinitionListResultIterator) Next() error { 3228 return iter.NextWithContext(context.Background()) 3229} 3230 3231// NotDone returns true if the enumeration should be started or is not yet complete. 3232func (iter RoleDefinitionListResultIterator) NotDone() bool { 3233 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3234} 3235 3236// Response returns the raw server response from the last page request. 3237func (iter RoleDefinitionListResultIterator) Response() RoleDefinitionListResult { 3238 return iter.page.Response() 3239} 3240 3241// Value returns the current value or a zero-initialized value if the 3242// iterator has advanced beyond the end of the collection. 3243func (iter RoleDefinitionListResultIterator) Value() RoleDefinition { 3244 if !iter.page.NotDone() { 3245 return RoleDefinition{} 3246 } 3247 return iter.page.Values()[iter.i] 3248} 3249 3250// Creates a new instance of the RoleDefinitionListResultIterator type. 3251func NewRoleDefinitionListResultIterator(page RoleDefinitionListResultPage) RoleDefinitionListResultIterator { 3252 return RoleDefinitionListResultIterator{page: page} 3253} 3254 3255// IsEmpty returns true if the ListResult contains no values. 3256func (rdlr RoleDefinitionListResult) IsEmpty() bool { 3257 return rdlr.Value == nil || len(*rdlr.Value) == 0 3258} 3259 3260// hasNextLink returns true if the NextLink is not empty. 3261func (rdlr RoleDefinitionListResult) hasNextLink() bool { 3262 return rdlr.NextLink != nil && len(*rdlr.NextLink) != 0 3263} 3264 3265// roleDefinitionListResultPreparer prepares a request to retrieve the next set of results. 3266// It returns nil if no more results exist. 3267func (rdlr RoleDefinitionListResult) roleDefinitionListResultPreparer(ctx context.Context) (*http.Request, error) { 3268 if !rdlr.hasNextLink() { 3269 return nil, nil 3270 } 3271 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3272 autorest.AsJSON(), 3273 autorest.AsGet(), 3274 autorest.WithBaseURL(to.String(rdlr.NextLink))) 3275} 3276 3277// RoleDefinitionListResultPage contains a page of RoleDefinition values. 3278type RoleDefinitionListResultPage struct { 3279 fn func(context.Context, RoleDefinitionListResult) (RoleDefinitionListResult, error) 3280 rdlr RoleDefinitionListResult 3281} 3282 3283// NextWithContext advances to the next page of values. If there was an error making 3284// the request the page does not advance and the error is returned. 3285func (page *RoleDefinitionListResultPage) NextWithContext(ctx context.Context) (err error) { 3286 if tracing.IsEnabled() { 3287 ctx = tracing.StartSpan(ctx, fqdn+"/RoleDefinitionListResultPage.NextWithContext") 3288 defer func() { 3289 sc := -1 3290 if page.Response().Response.Response != nil { 3291 sc = page.Response().Response.Response.StatusCode 3292 } 3293 tracing.EndSpan(ctx, sc, err) 3294 }() 3295 } 3296 for { 3297 next, err := page.fn(ctx, page.rdlr) 3298 if err != nil { 3299 return err 3300 } 3301 page.rdlr = next 3302 if !next.hasNextLink() || !next.IsEmpty() { 3303 break 3304 } 3305 } 3306 return nil 3307} 3308 3309// Next advances to the next page of values. If there was an error making 3310// the request the page does not advance and the error is returned. 3311// Deprecated: Use NextWithContext() instead. 3312func (page *RoleDefinitionListResultPage) Next() error { 3313 return page.NextWithContext(context.Background()) 3314} 3315 3316// NotDone returns true if the page enumeration should be started or is not yet complete. 3317func (page RoleDefinitionListResultPage) NotDone() bool { 3318 return !page.rdlr.IsEmpty() 3319} 3320 3321// Response returns the raw server response from the last page request. 3322func (page RoleDefinitionListResultPage) Response() RoleDefinitionListResult { 3323 return page.rdlr 3324} 3325 3326// Values returns the slice of values for the current page or nil if there are no values. 3327func (page RoleDefinitionListResultPage) Values() []RoleDefinition { 3328 if page.rdlr.IsEmpty() { 3329 return nil 3330 } 3331 return *page.rdlr.Value 3332} 3333 3334// Creates a new instance of the RoleDefinitionListResultPage type. 3335func NewRoleDefinitionListResultPage(cur RoleDefinitionListResult, getNextPage func(context.Context, RoleDefinitionListResult) (RoleDefinitionListResult, error)) RoleDefinitionListResultPage { 3336 return RoleDefinitionListResultPage{ 3337 fn: getNextPage, 3338 rdlr: cur, 3339 } 3340} 3341 3342// RoleDefinitionProperties role definition properties. 3343type RoleDefinitionProperties struct { 3344 // RoleName - The role name. 3345 RoleName *string `json:"roleName,omitempty"` 3346 // Description - The role definition description. 3347 Description *string `json:"description,omitempty"` 3348 // RoleType - The role type. 3349 RoleType *string `json:"type,omitempty"` 3350 // Permissions - Role definition permissions. 3351 Permissions *[]Permission `json:"permissions,omitempty"` 3352 // AssignableScopes - Role definition assignable scopes. 3353 AssignableScopes *[]string `json:"assignableScopes,omitempty"` 3354} 3355 3356// SasDefinitionAttributes the SAS definition management attributes. 3357type SasDefinitionAttributes struct { 3358 // Enabled - the enabled state of the object. 3359 Enabled *bool `json:"enabled,omitempty"` 3360 // Created - READ-ONLY; Creation time in UTC. 3361 Created *date.UnixTime `json:"created,omitempty"` 3362 // Updated - READ-ONLY; Last updated time in UTC. 3363 Updated *date.UnixTime `json:"updated,omitempty"` 3364 // RecoverableDays - READ-ONLY; softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0. 3365 RecoverableDays *int32 `json:"recoverableDays,omitempty"` 3366 // RecoveryLevel - READ-ONLY; 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', 'CustomizedRecoverablePurgeable', 'CustomizedRecoverable', 'CustomizedRecoverableProtectedSubscription' 3367 RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` 3368} 3369 3370// MarshalJSON is the custom marshaler for SasDefinitionAttributes. 3371func (sda SasDefinitionAttributes) MarshalJSON() ([]byte, error) { 3372 objectMap := make(map[string]interface{}) 3373 if sda.Enabled != nil { 3374 objectMap["enabled"] = sda.Enabled 3375 } 3376 return json.Marshal(objectMap) 3377} 3378 3379// SasDefinitionBundle a SAS definition bundle consists of key vault SAS definition details plus its 3380// attributes. 3381type SasDefinitionBundle struct { 3382 autorest.Response `json:"-"` 3383 // ID - READ-ONLY; The SAS definition id. 3384 ID *string `json:"id,omitempty"` 3385 // SecretID - READ-ONLY; Storage account SAS definition secret id. 3386 SecretID *string `json:"sid,omitempty"` 3387 // TemplateURI - READ-ONLY; 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. 3388 TemplateURI *string `json:"templateUri,omitempty"` 3389 // SasType - READ-ONLY; The type of SAS token the SAS definition will create. Possible values include: 'Account', 'Service' 3390 SasType SasTokenType `json:"sasType,omitempty"` 3391 // ValidityPeriod - READ-ONLY; The validity period of SAS tokens created according to the SAS definition. 3392 ValidityPeriod *string `json:"validityPeriod,omitempty"` 3393 // Attributes - READ-ONLY; The SAS definition attributes. 3394 Attributes *SasDefinitionAttributes `json:"attributes,omitempty"` 3395 // Tags - READ-ONLY; Application specific metadata in the form of key-value pairs 3396 Tags map[string]*string `json:"tags"` 3397} 3398 3399// MarshalJSON is the custom marshaler for SasDefinitionBundle. 3400func (sdb SasDefinitionBundle) MarshalJSON() ([]byte, error) { 3401 objectMap := make(map[string]interface{}) 3402 return json.Marshal(objectMap) 3403} 3404 3405// SasDefinitionCreateParameters the SAS definition create parameters. 3406type SasDefinitionCreateParameters struct { 3407 // 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. 3408 TemplateURI *string `json:"templateUri,omitempty"` 3409 // SasType - The type of SAS token the SAS definition will create. Possible values include: 'Account', 'Service' 3410 SasType SasTokenType `json:"sasType,omitempty"` 3411 // ValidityPeriod - The validity period of SAS tokens created according to the SAS definition. 3412 ValidityPeriod *string `json:"validityPeriod,omitempty"` 3413 // SasDefinitionAttributes - The attributes of the SAS definition. 3414 SasDefinitionAttributes *SasDefinitionAttributes `json:"attributes,omitempty"` 3415 // Tags - Application specific metadata in the form of key-value pairs. 3416 Tags map[string]*string `json:"tags"` 3417} 3418 3419// MarshalJSON is the custom marshaler for SasDefinitionCreateParameters. 3420func (sdcp SasDefinitionCreateParameters) MarshalJSON() ([]byte, error) { 3421 objectMap := make(map[string]interface{}) 3422 if sdcp.TemplateURI != nil { 3423 objectMap["templateUri"] = sdcp.TemplateURI 3424 } 3425 if sdcp.SasType != "" { 3426 objectMap["sasType"] = sdcp.SasType 3427 } 3428 if sdcp.ValidityPeriod != nil { 3429 objectMap["validityPeriod"] = sdcp.ValidityPeriod 3430 } 3431 if sdcp.SasDefinitionAttributes != nil { 3432 objectMap["attributes"] = sdcp.SasDefinitionAttributes 3433 } 3434 if sdcp.Tags != nil { 3435 objectMap["tags"] = sdcp.Tags 3436 } 3437 return json.Marshal(objectMap) 3438} 3439 3440// SasDefinitionItem the SAS definition item containing storage SAS definition metadata. 3441type SasDefinitionItem struct { 3442 // ID - READ-ONLY; The storage SAS identifier. 3443 ID *string `json:"id,omitempty"` 3444 // SecretID - READ-ONLY; The storage account SAS definition secret id. 3445 SecretID *string `json:"sid,omitempty"` 3446 // Attributes - READ-ONLY; The SAS definition management attributes. 3447 Attributes *SasDefinitionAttributes `json:"attributes,omitempty"` 3448 // Tags - READ-ONLY; Application specific metadata in the form of key-value pairs. 3449 Tags map[string]*string `json:"tags"` 3450} 3451 3452// MarshalJSON is the custom marshaler for SasDefinitionItem. 3453func (sdi SasDefinitionItem) MarshalJSON() ([]byte, error) { 3454 objectMap := make(map[string]interface{}) 3455 return json.Marshal(objectMap) 3456} 3457 3458// SasDefinitionListResult the storage account SAS definition list result. 3459type SasDefinitionListResult struct { 3460 autorest.Response `json:"-"` 3461 // Value - READ-ONLY; A response message containing a list of SAS definitions along with a link to the next page of SAS definitions. 3462 Value *[]SasDefinitionItem `json:"value,omitempty"` 3463 // NextLink - READ-ONLY; The URL to get the next set of SAS definitions. 3464 NextLink *string `json:"nextLink,omitempty"` 3465} 3466 3467// MarshalJSON is the custom marshaler for SasDefinitionListResult. 3468func (sdlr SasDefinitionListResult) MarshalJSON() ([]byte, error) { 3469 objectMap := make(map[string]interface{}) 3470 return json.Marshal(objectMap) 3471} 3472 3473// SasDefinitionListResultIterator provides access to a complete listing of SasDefinitionItem values. 3474type SasDefinitionListResultIterator struct { 3475 i int 3476 page SasDefinitionListResultPage 3477} 3478 3479// NextWithContext advances to the next value. If there was an error making 3480// the request the iterator does not advance and the error is returned. 3481func (iter *SasDefinitionListResultIterator) NextWithContext(ctx context.Context) (err error) { 3482 if tracing.IsEnabled() { 3483 ctx = tracing.StartSpan(ctx, fqdn+"/SasDefinitionListResultIterator.NextWithContext") 3484 defer func() { 3485 sc := -1 3486 if iter.Response().Response.Response != nil { 3487 sc = iter.Response().Response.Response.StatusCode 3488 } 3489 tracing.EndSpan(ctx, sc, err) 3490 }() 3491 } 3492 iter.i++ 3493 if iter.i < len(iter.page.Values()) { 3494 return nil 3495 } 3496 err = iter.page.NextWithContext(ctx) 3497 if err != nil { 3498 iter.i-- 3499 return err 3500 } 3501 iter.i = 0 3502 return nil 3503} 3504 3505// Next advances to the next value. If there was an error making 3506// the request the iterator does not advance and the error is returned. 3507// Deprecated: Use NextWithContext() instead. 3508func (iter *SasDefinitionListResultIterator) Next() error { 3509 return iter.NextWithContext(context.Background()) 3510} 3511 3512// NotDone returns true if the enumeration should be started or is not yet complete. 3513func (iter SasDefinitionListResultIterator) NotDone() bool { 3514 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3515} 3516 3517// Response returns the raw server response from the last page request. 3518func (iter SasDefinitionListResultIterator) Response() SasDefinitionListResult { 3519 return iter.page.Response() 3520} 3521 3522// Value returns the current value or a zero-initialized value if the 3523// iterator has advanced beyond the end of the collection. 3524func (iter SasDefinitionListResultIterator) Value() SasDefinitionItem { 3525 if !iter.page.NotDone() { 3526 return SasDefinitionItem{} 3527 } 3528 return iter.page.Values()[iter.i] 3529} 3530 3531// Creates a new instance of the SasDefinitionListResultIterator type. 3532func NewSasDefinitionListResultIterator(page SasDefinitionListResultPage) SasDefinitionListResultIterator { 3533 return SasDefinitionListResultIterator{page: page} 3534} 3535 3536// IsEmpty returns true if the ListResult contains no values. 3537func (sdlr SasDefinitionListResult) IsEmpty() bool { 3538 return sdlr.Value == nil || len(*sdlr.Value) == 0 3539} 3540 3541// hasNextLink returns true if the NextLink is not empty. 3542func (sdlr SasDefinitionListResult) hasNextLink() bool { 3543 return sdlr.NextLink != nil && len(*sdlr.NextLink) != 0 3544} 3545 3546// sasDefinitionListResultPreparer prepares a request to retrieve the next set of results. 3547// It returns nil if no more results exist. 3548func (sdlr SasDefinitionListResult) sasDefinitionListResultPreparer(ctx context.Context) (*http.Request, error) { 3549 if !sdlr.hasNextLink() { 3550 return nil, nil 3551 } 3552 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3553 autorest.AsJSON(), 3554 autorest.AsGet(), 3555 autorest.WithBaseURL(to.String(sdlr.NextLink))) 3556} 3557 3558// SasDefinitionListResultPage contains a page of SasDefinitionItem values. 3559type SasDefinitionListResultPage struct { 3560 fn func(context.Context, SasDefinitionListResult) (SasDefinitionListResult, error) 3561 sdlr SasDefinitionListResult 3562} 3563 3564// NextWithContext advances to the next page of values. If there was an error making 3565// the request the page does not advance and the error is returned. 3566func (page *SasDefinitionListResultPage) NextWithContext(ctx context.Context) (err error) { 3567 if tracing.IsEnabled() { 3568 ctx = tracing.StartSpan(ctx, fqdn+"/SasDefinitionListResultPage.NextWithContext") 3569 defer func() { 3570 sc := -1 3571 if page.Response().Response.Response != nil { 3572 sc = page.Response().Response.Response.StatusCode 3573 } 3574 tracing.EndSpan(ctx, sc, err) 3575 }() 3576 } 3577 for { 3578 next, err := page.fn(ctx, page.sdlr) 3579 if err != nil { 3580 return err 3581 } 3582 page.sdlr = next 3583 if !next.hasNextLink() || !next.IsEmpty() { 3584 break 3585 } 3586 } 3587 return nil 3588} 3589 3590// Next advances to the next page of values. If there was an error making 3591// the request the page does not advance and the error is returned. 3592// Deprecated: Use NextWithContext() instead. 3593func (page *SasDefinitionListResultPage) Next() error { 3594 return page.NextWithContext(context.Background()) 3595} 3596 3597// NotDone returns true if the page enumeration should be started or is not yet complete. 3598func (page SasDefinitionListResultPage) NotDone() bool { 3599 return !page.sdlr.IsEmpty() 3600} 3601 3602// Response returns the raw server response from the last page request. 3603func (page SasDefinitionListResultPage) Response() SasDefinitionListResult { 3604 return page.sdlr 3605} 3606 3607// Values returns the slice of values for the current page or nil if there are no values. 3608func (page SasDefinitionListResultPage) Values() []SasDefinitionItem { 3609 if page.sdlr.IsEmpty() { 3610 return nil 3611 } 3612 return *page.sdlr.Value 3613} 3614 3615// Creates a new instance of the SasDefinitionListResultPage type. 3616func NewSasDefinitionListResultPage(cur SasDefinitionListResult, getNextPage func(context.Context, SasDefinitionListResult) (SasDefinitionListResult, error)) SasDefinitionListResultPage { 3617 return SasDefinitionListResultPage{ 3618 fn: getNextPage, 3619 sdlr: cur, 3620 } 3621} 3622 3623// SasDefinitionUpdateParameters the SAS definition update parameters. 3624type SasDefinitionUpdateParameters struct { 3625 // 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. 3626 TemplateURI *string `json:"templateUri,omitempty"` 3627 // SasType - The type of SAS token the SAS definition will create. Possible values include: 'Account', 'Service' 3628 SasType SasTokenType `json:"sasType,omitempty"` 3629 // ValidityPeriod - The validity period of SAS tokens created according to the SAS definition. 3630 ValidityPeriod *string `json:"validityPeriod,omitempty"` 3631 // SasDefinitionAttributes - The attributes of the SAS definition. 3632 SasDefinitionAttributes *SasDefinitionAttributes `json:"attributes,omitempty"` 3633 // Tags - Application specific metadata in the form of key-value pairs. 3634 Tags map[string]*string `json:"tags"` 3635} 3636 3637// MarshalJSON is the custom marshaler for SasDefinitionUpdateParameters. 3638func (sdup SasDefinitionUpdateParameters) MarshalJSON() ([]byte, error) { 3639 objectMap := make(map[string]interface{}) 3640 if sdup.TemplateURI != nil { 3641 objectMap["templateUri"] = sdup.TemplateURI 3642 } 3643 if sdup.SasType != "" { 3644 objectMap["sasType"] = sdup.SasType 3645 } 3646 if sdup.ValidityPeriod != nil { 3647 objectMap["validityPeriod"] = sdup.ValidityPeriod 3648 } 3649 if sdup.SasDefinitionAttributes != nil { 3650 objectMap["attributes"] = sdup.SasDefinitionAttributes 3651 } 3652 if sdup.Tags != nil { 3653 objectMap["tags"] = sdup.Tags 3654 } 3655 return json.Marshal(objectMap) 3656} 3657 3658// SASTokenParameter ... 3659type SASTokenParameter struct { 3660 // StorageResourceURI - Azure Blob storage container Uri 3661 StorageResourceURI *string `json:"storageResourceUri,omitempty"` 3662 // Token - The SAS token pointing to an Azure Blob storage container 3663 Token *string `json:"token,omitempty"` 3664} 3665 3666// SecretAttributes the secret management attributes. 3667type SecretAttributes struct { 3668 // RecoverableDays - READ-ONLY; softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0. 3669 RecoverableDays *int32 `json:"recoverableDays,omitempty"` 3670 // RecoveryLevel - READ-ONLY; 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', 'CustomizedRecoverablePurgeable', 'CustomizedRecoverable', 'CustomizedRecoverableProtectedSubscription' 3671 RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` 3672 // Enabled - Determines whether the object is enabled. 3673 Enabled *bool `json:"enabled,omitempty"` 3674 // NotBefore - Not before date in UTC. 3675 NotBefore *date.UnixTime `json:"nbf,omitempty"` 3676 // Expires - Expiry date in UTC. 3677 Expires *date.UnixTime `json:"exp,omitempty"` 3678 // Created - READ-ONLY; Creation time in UTC. 3679 Created *date.UnixTime `json:"created,omitempty"` 3680 // Updated - READ-ONLY; Last updated time in UTC. 3681 Updated *date.UnixTime `json:"updated,omitempty"` 3682} 3683 3684// MarshalJSON is the custom marshaler for SecretAttributes. 3685func (sa SecretAttributes) MarshalJSON() ([]byte, error) { 3686 objectMap := make(map[string]interface{}) 3687 if sa.Enabled != nil { 3688 objectMap["enabled"] = sa.Enabled 3689 } 3690 if sa.NotBefore != nil { 3691 objectMap["nbf"] = sa.NotBefore 3692 } 3693 if sa.Expires != nil { 3694 objectMap["exp"] = sa.Expires 3695 } 3696 return json.Marshal(objectMap) 3697} 3698 3699// SecretBundle a secret consisting of a value, id and its attributes. 3700type SecretBundle struct { 3701 autorest.Response `json:"-"` 3702 // Value - The secret value. 3703 Value *string `json:"value,omitempty"` 3704 // ID - The secret id. 3705 ID *string `json:"id,omitempty"` 3706 // ContentType - The content type of the secret. 3707 ContentType *string `json:"contentType,omitempty"` 3708 // Attributes - The secret management attributes. 3709 Attributes *SecretAttributes `json:"attributes,omitempty"` 3710 // Tags - Application specific metadata in the form of key-value pairs. 3711 Tags map[string]*string `json:"tags"` 3712 // Kid - READ-ONLY; If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate. 3713 Kid *string `json:"kid,omitempty"` 3714 // Managed - READ-ONLY; True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be true. 3715 Managed *bool `json:"managed,omitempty"` 3716} 3717 3718// MarshalJSON is the custom marshaler for SecretBundle. 3719func (sb SecretBundle) MarshalJSON() ([]byte, error) { 3720 objectMap := make(map[string]interface{}) 3721 if sb.Value != nil { 3722 objectMap["value"] = sb.Value 3723 } 3724 if sb.ID != nil { 3725 objectMap["id"] = sb.ID 3726 } 3727 if sb.ContentType != nil { 3728 objectMap["contentType"] = sb.ContentType 3729 } 3730 if sb.Attributes != nil { 3731 objectMap["attributes"] = sb.Attributes 3732 } 3733 if sb.Tags != nil { 3734 objectMap["tags"] = sb.Tags 3735 } 3736 return json.Marshal(objectMap) 3737} 3738 3739// SecretItem the secret item containing secret metadata. 3740type SecretItem struct { 3741 // ID - Secret identifier. 3742 ID *string `json:"id,omitempty"` 3743 // Attributes - The secret management attributes. 3744 Attributes *SecretAttributes `json:"attributes,omitempty"` 3745 // Tags - Application specific metadata in the form of key-value pairs. 3746 Tags map[string]*string `json:"tags"` 3747 // ContentType - Type of the secret value such as a password. 3748 ContentType *string `json:"contentType,omitempty"` 3749 // Managed - READ-ONLY; True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. 3750 Managed *bool `json:"managed,omitempty"` 3751} 3752 3753// MarshalJSON is the custom marshaler for SecretItem. 3754func (si SecretItem) MarshalJSON() ([]byte, error) { 3755 objectMap := make(map[string]interface{}) 3756 if si.ID != nil { 3757 objectMap["id"] = si.ID 3758 } 3759 if si.Attributes != nil { 3760 objectMap["attributes"] = si.Attributes 3761 } 3762 if si.Tags != nil { 3763 objectMap["tags"] = si.Tags 3764 } 3765 if si.ContentType != nil { 3766 objectMap["contentType"] = si.ContentType 3767 } 3768 return json.Marshal(objectMap) 3769} 3770 3771// SecretListResult the secret list result. 3772type SecretListResult struct { 3773 autorest.Response `json:"-"` 3774 // Value - READ-ONLY; A response message containing a list of secrets in the key vault along with a link to the next page of secrets. 3775 Value *[]SecretItem `json:"value,omitempty"` 3776 // NextLink - READ-ONLY; The URL to get the next set of secrets. 3777 NextLink *string `json:"nextLink,omitempty"` 3778} 3779 3780// MarshalJSON is the custom marshaler for SecretListResult. 3781func (slr SecretListResult) MarshalJSON() ([]byte, error) { 3782 objectMap := make(map[string]interface{}) 3783 return json.Marshal(objectMap) 3784} 3785 3786// SecretListResultIterator provides access to a complete listing of SecretItem values. 3787type SecretListResultIterator struct { 3788 i int 3789 page SecretListResultPage 3790} 3791 3792// NextWithContext advances to the next value. If there was an error making 3793// the request the iterator does not advance and the error is returned. 3794func (iter *SecretListResultIterator) NextWithContext(ctx context.Context) (err error) { 3795 if tracing.IsEnabled() { 3796 ctx = tracing.StartSpan(ctx, fqdn+"/SecretListResultIterator.NextWithContext") 3797 defer func() { 3798 sc := -1 3799 if iter.Response().Response.Response != nil { 3800 sc = iter.Response().Response.Response.StatusCode 3801 } 3802 tracing.EndSpan(ctx, sc, err) 3803 }() 3804 } 3805 iter.i++ 3806 if iter.i < len(iter.page.Values()) { 3807 return nil 3808 } 3809 err = iter.page.NextWithContext(ctx) 3810 if err != nil { 3811 iter.i-- 3812 return err 3813 } 3814 iter.i = 0 3815 return nil 3816} 3817 3818// Next advances to the next value. If there was an error making 3819// the request the iterator does not advance and the error is returned. 3820// Deprecated: Use NextWithContext() instead. 3821func (iter *SecretListResultIterator) Next() error { 3822 return iter.NextWithContext(context.Background()) 3823} 3824 3825// NotDone returns true if the enumeration should be started or is not yet complete. 3826func (iter SecretListResultIterator) NotDone() bool { 3827 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3828} 3829 3830// Response returns the raw server response from the last page request. 3831func (iter SecretListResultIterator) Response() SecretListResult { 3832 return iter.page.Response() 3833} 3834 3835// Value returns the current value or a zero-initialized value if the 3836// iterator has advanced beyond the end of the collection. 3837func (iter SecretListResultIterator) Value() SecretItem { 3838 if !iter.page.NotDone() { 3839 return SecretItem{} 3840 } 3841 return iter.page.Values()[iter.i] 3842} 3843 3844// Creates a new instance of the SecretListResultIterator type. 3845func NewSecretListResultIterator(page SecretListResultPage) SecretListResultIterator { 3846 return SecretListResultIterator{page: page} 3847} 3848 3849// IsEmpty returns true if the ListResult contains no values. 3850func (slr SecretListResult) IsEmpty() bool { 3851 return slr.Value == nil || len(*slr.Value) == 0 3852} 3853 3854// hasNextLink returns true if the NextLink is not empty. 3855func (slr SecretListResult) hasNextLink() bool { 3856 return slr.NextLink != nil && len(*slr.NextLink) != 0 3857} 3858 3859// secretListResultPreparer prepares a request to retrieve the next set of results. 3860// It returns nil if no more results exist. 3861func (slr SecretListResult) secretListResultPreparer(ctx context.Context) (*http.Request, error) { 3862 if !slr.hasNextLink() { 3863 return nil, nil 3864 } 3865 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3866 autorest.AsJSON(), 3867 autorest.AsGet(), 3868 autorest.WithBaseURL(to.String(slr.NextLink))) 3869} 3870 3871// SecretListResultPage contains a page of SecretItem values. 3872type SecretListResultPage struct { 3873 fn func(context.Context, SecretListResult) (SecretListResult, error) 3874 slr SecretListResult 3875} 3876 3877// NextWithContext advances to the next page of values. If there was an error making 3878// the request the page does not advance and the error is returned. 3879func (page *SecretListResultPage) NextWithContext(ctx context.Context) (err error) { 3880 if tracing.IsEnabled() { 3881 ctx = tracing.StartSpan(ctx, fqdn+"/SecretListResultPage.NextWithContext") 3882 defer func() { 3883 sc := -1 3884 if page.Response().Response.Response != nil { 3885 sc = page.Response().Response.Response.StatusCode 3886 } 3887 tracing.EndSpan(ctx, sc, err) 3888 }() 3889 } 3890 for { 3891 next, err := page.fn(ctx, page.slr) 3892 if err != nil { 3893 return err 3894 } 3895 page.slr = next 3896 if !next.hasNextLink() || !next.IsEmpty() { 3897 break 3898 } 3899 } 3900 return nil 3901} 3902 3903// Next advances to the next page of values. If there was an error making 3904// the request the page does not advance and the error is returned. 3905// Deprecated: Use NextWithContext() instead. 3906func (page *SecretListResultPage) Next() error { 3907 return page.NextWithContext(context.Background()) 3908} 3909 3910// NotDone returns true if the page enumeration should be started or is not yet complete. 3911func (page SecretListResultPage) NotDone() bool { 3912 return !page.slr.IsEmpty() 3913} 3914 3915// Response returns the raw server response from the last page request. 3916func (page SecretListResultPage) Response() SecretListResult { 3917 return page.slr 3918} 3919 3920// Values returns the slice of values for the current page or nil if there are no values. 3921func (page SecretListResultPage) Values() []SecretItem { 3922 if page.slr.IsEmpty() { 3923 return nil 3924 } 3925 return *page.slr.Value 3926} 3927 3928// Creates a new instance of the SecretListResultPage type. 3929func NewSecretListResultPage(cur SecretListResult, getNextPage func(context.Context, SecretListResult) (SecretListResult, error)) SecretListResultPage { 3930 return SecretListResultPage{ 3931 fn: getNextPage, 3932 slr: cur, 3933 } 3934} 3935 3936// SecretProperties properties of the key backing a certificate. 3937type SecretProperties struct { 3938 // ContentType - The media type (MIME type). 3939 ContentType *string `json:"contentType,omitempty"` 3940} 3941 3942// SecretRestoreParameters the secret restore parameters. 3943type SecretRestoreParameters struct { 3944 // SecretBundleBackup - The backup blob associated with a secret bundle. (a URL-encoded base64 string) 3945 SecretBundleBackup *string `json:"value,omitempty"` 3946} 3947 3948// SecretSetParameters the secret set parameters. 3949type SecretSetParameters struct { 3950 // Value - The value of the secret. 3951 Value *string `json:"value,omitempty"` 3952 // Tags - Application specific metadata in the form of key-value pairs. 3953 Tags map[string]*string `json:"tags"` 3954 // ContentType - Type of the secret value such as a password. 3955 ContentType *string `json:"contentType,omitempty"` 3956 // SecretAttributes - The secret management attributes. 3957 SecretAttributes *SecretAttributes `json:"attributes,omitempty"` 3958} 3959 3960// MarshalJSON is the custom marshaler for SecretSetParameters. 3961func (ssp SecretSetParameters) MarshalJSON() ([]byte, error) { 3962 objectMap := make(map[string]interface{}) 3963 if ssp.Value != nil { 3964 objectMap["value"] = ssp.Value 3965 } 3966 if ssp.Tags != nil { 3967 objectMap["tags"] = ssp.Tags 3968 } 3969 if ssp.ContentType != nil { 3970 objectMap["contentType"] = ssp.ContentType 3971 } 3972 if ssp.SecretAttributes != nil { 3973 objectMap["attributes"] = ssp.SecretAttributes 3974 } 3975 return json.Marshal(objectMap) 3976} 3977 3978// SecretUpdateParameters the secret update parameters. 3979type SecretUpdateParameters struct { 3980 // ContentType - Type of the secret value such as a password. 3981 ContentType *string `json:"contentType,omitempty"` 3982 // SecretAttributes - The secret management attributes. 3983 SecretAttributes *SecretAttributes `json:"attributes,omitempty"` 3984 // Tags - Application specific metadata in the form of key-value pairs. 3985 Tags map[string]*string `json:"tags"` 3986} 3987 3988// MarshalJSON is the custom marshaler for SecretUpdateParameters. 3989func (sup SecretUpdateParameters) MarshalJSON() ([]byte, error) { 3990 objectMap := make(map[string]interface{}) 3991 if sup.ContentType != nil { 3992 objectMap["contentType"] = sup.ContentType 3993 } 3994 if sup.SecretAttributes != nil { 3995 objectMap["attributes"] = sup.SecretAttributes 3996 } 3997 if sup.Tags != nil { 3998 objectMap["tags"] = sup.Tags 3999 } 4000 return json.Marshal(objectMap) 4001} 4002 4003// SecurityDomainCertificateItem ... 4004type SecurityDomainCertificateItem struct { 4005 // Value - Customer generated certificate containing public key in JWK format 4006 Value *SecurityDomainJSONWebKey `json:"value,omitempty"` 4007} 4008 4009// SecurityDomainJSONWebKey ... 4010type SecurityDomainJSONWebKey struct { 4011 // Kid - Key identifier. 4012 Kid *string `json:"kid,omitempty"` 4013 // Kty - JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. For security domain this value must be RSA 4014 Kty *string `json:"kty,omitempty"` 4015 KeyOps *[]string `json:"key_ops,omitempty"` 4016 // N - RSA modulus. 4017 N *string `json:"n,omitempty"` 4018 // E - RSA public exponent. 4019 E *string `json:"e,omitempty"` 4020 // X5c - X509 certificate chain parameter 4021 X5c *[]string `json:"x5c,omitempty"` 4022 // Use - Public Key Use Parameter. This is optional and if present must be enc. 4023 Use *string `json:"use,omitempty"` 4024 // X5t - X509 certificate SHA1 thumbprint. This is optional. 4025 X5t *string `json:"x5t,omitempty"` 4026 // X5tS256 - X509 certificate SHA256 thumbprint. 4027 X5tS256 *string `json:"x5t#S256,omitempty"` 4028 // Alg - Algorithm intended for use with the key. 4029 Alg *string `json:"alg,omitempty"` 4030} 4031 4032// SecurityDomainObject security domain 4033type SecurityDomainObject struct { 4034 autorest.Response `json:"-"` 4035 Data *SecurityDomainObjectData `json:"data,omitempty"` 4036} 4037 4038// SecurityDomainObjectData ... 4039type SecurityDomainObjectData struct { 4040 // EncData - Array of encrypted data set 4041 EncData *EncDataSet `json:"EncData,omitempty"` 4042 // SharedKeys - Array of shared keys 4043 SharedKeys *SecurityDomainObjectDataSharedKeys `json:"SharedKeys,omitempty"` 4044 Version *int32 `json:"version,omitempty"` 4045} 4046 4047// SecurityDomainObjectDataSharedKeys array of shared keys 4048type SecurityDomainObjectDataSharedKeys struct { 4049 // KeyAlgorithm - The Algorithm used for shared keys 4050 KeyAlgorithm *string `json:"key_algorithm,omitempty"` 4051 // Required - The number of keys (minimum 2 and maximum 10) required for security domain. 4052 Required *int32 `json:"required,omitempty"` 4053 // EncShares - Compact JWE wrapped shares array 4054 EncShares *[]Key `json:"enc_shares,omitempty"` 4055} 4056 4057// SecurityDomainOperationStatus ... 4058type SecurityDomainOperationStatus struct { 4059 autorest.Response `json:"-"` 4060 // Status - operation status. Possible values include: 'Success', 'InProgress', 'Failed' 4061 Status OperationStatus `json:"status,omitempty"` 4062 StatusDetails *string `json:"status_details,omitempty"` 4063} 4064 4065// SecurityDomainUploadObject security domain object uploaded to a new pool 4066type SecurityDomainUploadObject struct { 4067 Value *SecurityDomainUploadObjectValue `json:"value,omitempty"` 4068} 4069 4070// SecurityDomainUploadObjectValue ... 4071type SecurityDomainUploadObjectValue struct { 4072 // EncData - Array of encrypted data set 4073 EncData *EncDataSet `json:"EncData,omitempty"` 4074 // WrappedKey - Key object containing the encryption key used to encrypt EncData object 4075 WrappedKey *SecurityDomainUploadObjectValueWrappedKey `json:"WrappedKey,omitempty"` 4076} 4077 4078// SecurityDomainUploadObjectValueWrappedKey key object containing the encryption key used to encrypt 4079// EncData object 4080type SecurityDomainUploadObjectValueWrappedKey struct { 4081 // EncKey - Encryption key used to encrypt the EncData 4082 EncKey *string `json:"enc_key,omitempty"` 4083 // X5t256 - Thumbprint used to determine which certificate was used to encrypt the enc_key field 4084 X5t256 *string `json:"x5t_256,omitempty"` 4085} 4086 4087// SelectiveKeyRestoreOperation selective Key Restore operation 4088type SelectiveKeyRestoreOperation struct { 4089 autorest.Response `json:"-"` 4090 // Status - Status of the restore operation. 4091 Status *string `json:"status,omitempty"` 4092 // StatusDetails - The status details of restore operation. 4093 StatusDetails *string `json:"statusDetails,omitempty"` 4094 // Error - Error encountered, if any, during the selective key restore operation. 4095 Error *Error `json:"error,omitempty"` 4096 // JobID - Identifier for the selective key restore operation. 4097 JobID *string `json:"jobId,omitempty"` 4098 // StartTime - The start time of the restore operation 4099 StartTime *date.UnixTime `json:"startTime,omitempty"` 4100 // EndTime - The end time of the restore operation 4101 EndTime *date.UnixTime `json:"endTime,omitempty"` 4102} 4103 4104// SelectiveKeyRestoreOperationMethodFuture an abstraction for monitoring and retrieving the results of a 4105// long-running operation. 4106type SelectiveKeyRestoreOperationMethodFuture struct { 4107 azure.FutureAPI 4108 // Result returns the result of the asynchronous operation. 4109 // If the operation has not completed it will return an error. 4110 Result func(BaseClient) (SelectiveKeyRestoreOperation, error) 4111} 4112 4113// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4114func (future *SelectiveKeyRestoreOperationMethodFuture) UnmarshalJSON(body []byte) error { 4115 var azFuture azure.Future 4116 if err := json.Unmarshal(body, &azFuture); err != nil { 4117 return err 4118 } 4119 future.FutureAPI = &azFuture 4120 future.Result = future.result 4121 return nil 4122} 4123 4124// result is the default implementation for SelectiveKeyRestoreOperationMethodFuture.Result. 4125func (future *SelectiveKeyRestoreOperationMethodFuture) result(client BaseClient) (skro SelectiveKeyRestoreOperation, err error) { 4126 var done bool 4127 done, err = future.DoneWithContext(context.Background(), client) 4128 if err != nil { 4129 err = autorest.NewErrorWithError(err, "keyvault.SelectiveKeyRestoreOperationMethodFuture", "Result", future.Response(), "Polling failure") 4130 return 4131 } 4132 if !done { 4133 skro.Response.Response = future.Response() 4134 err = azure.NewAsyncOpIncompleteError("keyvault.SelectiveKeyRestoreOperationMethodFuture") 4135 return 4136 } 4137 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4138 if skro.Response.Response, err = future.GetResult(sender); err == nil && skro.Response.Response.StatusCode != http.StatusNoContent { 4139 skro, err = client.SelectiveKeyRestoreOperationMethodResponder(skro.Response.Response) 4140 if err != nil { 4141 err = autorest.NewErrorWithError(err, "keyvault.SelectiveKeyRestoreOperationMethodFuture", "Result", skro.Response.Response, "Failure responding to request") 4142 } 4143 } 4144 return 4145} 4146 4147// SelectiveKeyRestoreOperationParameters ... 4148type SelectiveKeyRestoreOperationParameters struct { 4149 SasTokenParameters *SASTokenParameter `json:"sasTokenParameters,omitempty"` 4150 // Folder - The Folder name of the blob where the previous successful full backup was stored 4151 Folder *string `json:"folder,omitempty"` 4152} 4153 4154// StorageAccountAttributes the storage account management attributes. 4155type StorageAccountAttributes struct { 4156 // Enabled - the enabled state of the object. 4157 Enabled *bool `json:"enabled,omitempty"` 4158 // Created - READ-ONLY; Creation time in UTC. 4159 Created *date.UnixTime `json:"created,omitempty"` 4160 // Updated - READ-ONLY; Last updated time in UTC. 4161 Updated *date.UnixTime `json:"updated,omitempty"` 4162 // RecoverableDays - READ-ONLY; softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0. 4163 RecoverableDays *int32 `json:"recoverableDays,omitempty"` 4164 // RecoveryLevel - READ-ONLY; 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', 'CustomizedRecoverablePurgeable', 'CustomizedRecoverable', 'CustomizedRecoverableProtectedSubscription' 4165 RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` 4166} 4167 4168// MarshalJSON is the custom marshaler for StorageAccountAttributes. 4169func (saa StorageAccountAttributes) MarshalJSON() ([]byte, error) { 4170 objectMap := make(map[string]interface{}) 4171 if saa.Enabled != nil { 4172 objectMap["enabled"] = saa.Enabled 4173 } 4174 return json.Marshal(objectMap) 4175} 4176 4177// StorageAccountCreateParameters the storage account create parameters. 4178type StorageAccountCreateParameters struct { 4179 // ResourceID - Storage account resource id. 4180 ResourceID *string `json:"resourceId,omitempty"` 4181 // ActiveKeyName - Current active storage account key name. 4182 ActiveKeyName *string `json:"activeKeyName,omitempty"` 4183 // AutoRegenerateKey - whether keyvault should manage the storage account for the user. 4184 AutoRegenerateKey *bool `json:"autoRegenerateKey,omitempty"` 4185 // RegenerationPeriod - The key regeneration time duration specified in ISO-8601 format. 4186 RegenerationPeriod *string `json:"regenerationPeriod,omitempty"` 4187 // StorageAccountAttributes - The attributes of the storage account. 4188 StorageAccountAttributes *StorageAccountAttributes `json:"attributes,omitempty"` 4189 // Tags - Application specific metadata in the form of key-value pairs. 4190 Tags map[string]*string `json:"tags"` 4191} 4192 4193// MarshalJSON is the custom marshaler for StorageAccountCreateParameters. 4194func (sacp StorageAccountCreateParameters) MarshalJSON() ([]byte, error) { 4195 objectMap := make(map[string]interface{}) 4196 if sacp.ResourceID != nil { 4197 objectMap["resourceId"] = sacp.ResourceID 4198 } 4199 if sacp.ActiveKeyName != nil { 4200 objectMap["activeKeyName"] = sacp.ActiveKeyName 4201 } 4202 if sacp.AutoRegenerateKey != nil { 4203 objectMap["autoRegenerateKey"] = sacp.AutoRegenerateKey 4204 } 4205 if sacp.RegenerationPeriod != nil { 4206 objectMap["regenerationPeriod"] = sacp.RegenerationPeriod 4207 } 4208 if sacp.StorageAccountAttributes != nil { 4209 objectMap["attributes"] = sacp.StorageAccountAttributes 4210 } 4211 if sacp.Tags != nil { 4212 objectMap["tags"] = sacp.Tags 4213 } 4214 return json.Marshal(objectMap) 4215} 4216 4217// StorageAccountItem the storage account item containing storage account metadata. 4218type StorageAccountItem struct { 4219 // ID - READ-ONLY; Storage identifier. 4220 ID *string `json:"id,omitempty"` 4221 // ResourceID - READ-ONLY; Storage account resource Id. 4222 ResourceID *string `json:"resourceId,omitempty"` 4223 // Attributes - READ-ONLY; The storage account management attributes. 4224 Attributes *StorageAccountAttributes `json:"attributes,omitempty"` 4225 // Tags - READ-ONLY; Application specific metadata in the form of key-value pairs. 4226 Tags map[string]*string `json:"tags"` 4227} 4228 4229// MarshalJSON is the custom marshaler for StorageAccountItem. 4230func (sai StorageAccountItem) MarshalJSON() ([]byte, error) { 4231 objectMap := make(map[string]interface{}) 4232 return json.Marshal(objectMap) 4233} 4234 4235// StorageAccountRegenerteKeyParameters the storage account key regenerate parameters. 4236type StorageAccountRegenerteKeyParameters struct { 4237 // KeyName - The storage account key name. 4238 KeyName *string `json:"keyName,omitempty"` 4239} 4240 4241// StorageAccountUpdateParameters the storage account update parameters. 4242type StorageAccountUpdateParameters struct { 4243 // ActiveKeyName - The current active storage account key name. 4244 ActiveKeyName *string `json:"activeKeyName,omitempty"` 4245 // AutoRegenerateKey - whether keyvault should manage the storage account for the user. 4246 AutoRegenerateKey *bool `json:"autoRegenerateKey,omitempty"` 4247 // RegenerationPeriod - The key regeneration time duration specified in ISO-8601 format. 4248 RegenerationPeriod *string `json:"regenerationPeriod,omitempty"` 4249 // StorageAccountAttributes - The attributes of the storage account. 4250 StorageAccountAttributes *StorageAccountAttributes `json:"attributes,omitempty"` 4251 // Tags - Application specific metadata in the form of key-value pairs. 4252 Tags map[string]*string `json:"tags"` 4253} 4254 4255// MarshalJSON is the custom marshaler for StorageAccountUpdateParameters. 4256func (saup StorageAccountUpdateParameters) MarshalJSON() ([]byte, error) { 4257 objectMap := make(map[string]interface{}) 4258 if saup.ActiveKeyName != nil { 4259 objectMap["activeKeyName"] = saup.ActiveKeyName 4260 } 4261 if saup.AutoRegenerateKey != nil { 4262 objectMap["autoRegenerateKey"] = saup.AutoRegenerateKey 4263 } 4264 if saup.RegenerationPeriod != nil { 4265 objectMap["regenerationPeriod"] = saup.RegenerationPeriod 4266 } 4267 if saup.StorageAccountAttributes != nil { 4268 objectMap["attributes"] = saup.StorageAccountAttributes 4269 } 4270 if saup.Tags != nil { 4271 objectMap["tags"] = saup.Tags 4272 } 4273 return json.Marshal(objectMap) 4274} 4275 4276// StorageBundle a Storage account bundle consists of key vault storage account details plus its 4277// attributes. 4278type StorageBundle struct { 4279 autorest.Response `json:"-"` 4280 // ID - READ-ONLY; The storage account id. 4281 ID *string `json:"id,omitempty"` 4282 // ResourceID - READ-ONLY; The storage account resource id. 4283 ResourceID *string `json:"resourceId,omitempty"` 4284 // ActiveKeyName - READ-ONLY; The current active storage account key name. 4285 ActiveKeyName *string `json:"activeKeyName,omitempty"` 4286 // AutoRegenerateKey - READ-ONLY; whether keyvault should manage the storage account for the user. 4287 AutoRegenerateKey *bool `json:"autoRegenerateKey,omitempty"` 4288 // RegenerationPeriod - READ-ONLY; The key regeneration time duration specified in ISO-8601 format. 4289 RegenerationPeriod *string `json:"regenerationPeriod,omitempty"` 4290 // Attributes - READ-ONLY; The storage account attributes. 4291 Attributes *StorageAccountAttributes `json:"attributes,omitempty"` 4292 // Tags - READ-ONLY; Application specific metadata in the form of key-value pairs 4293 Tags map[string]*string `json:"tags"` 4294} 4295 4296// MarshalJSON is the custom marshaler for StorageBundle. 4297func (sb StorageBundle) MarshalJSON() ([]byte, error) { 4298 objectMap := make(map[string]interface{}) 4299 return json.Marshal(objectMap) 4300} 4301 4302// StorageListResult the storage accounts list result. 4303type StorageListResult struct { 4304 autorest.Response `json:"-"` 4305 // Value - READ-ONLY; A response message containing a list of storage accounts in the key vault along with a link to the next page of storage accounts. 4306 Value *[]StorageAccountItem `json:"value,omitempty"` 4307 // NextLink - READ-ONLY; The URL to get the next set of storage accounts. 4308 NextLink *string `json:"nextLink,omitempty"` 4309} 4310 4311// MarshalJSON is the custom marshaler for StorageListResult. 4312func (slr StorageListResult) MarshalJSON() ([]byte, error) { 4313 objectMap := make(map[string]interface{}) 4314 return json.Marshal(objectMap) 4315} 4316 4317// StorageListResultIterator provides access to a complete listing of StorageAccountItem values. 4318type StorageListResultIterator struct { 4319 i int 4320 page StorageListResultPage 4321} 4322 4323// NextWithContext advances to the next value. If there was an error making 4324// the request the iterator does not advance and the error is returned. 4325func (iter *StorageListResultIterator) NextWithContext(ctx context.Context) (err error) { 4326 if tracing.IsEnabled() { 4327 ctx = tracing.StartSpan(ctx, fqdn+"/StorageListResultIterator.NextWithContext") 4328 defer func() { 4329 sc := -1 4330 if iter.Response().Response.Response != nil { 4331 sc = iter.Response().Response.Response.StatusCode 4332 } 4333 tracing.EndSpan(ctx, sc, err) 4334 }() 4335 } 4336 iter.i++ 4337 if iter.i < len(iter.page.Values()) { 4338 return nil 4339 } 4340 err = iter.page.NextWithContext(ctx) 4341 if err != nil { 4342 iter.i-- 4343 return err 4344 } 4345 iter.i = 0 4346 return nil 4347} 4348 4349// Next advances to the next value. If there was an error making 4350// the request the iterator does not advance and the error is returned. 4351// Deprecated: Use NextWithContext() instead. 4352func (iter *StorageListResultIterator) Next() error { 4353 return iter.NextWithContext(context.Background()) 4354} 4355 4356// NotDone returns true if the enumeration should be started or is not yet complete. 4357func (iter StorageListResultIterator) NotDone() bool { 4358 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4359} 4360 4361// Response returns the raw server response from the last page request. 4362func (iter StorageListResultIterator) Response() StorageListResult { 4363 return iter.page.Response() 4364} 4365 4366// Value returns the current value or a zero-initialized value if the 4367// iterator has advanced beyond the end of the collection. 4368func (iter StorageListResultIterator) Value() StorageAccountItem { 4369 if !iter.page.NotDone() { 4370 return StorageAccountItem{} 4371 } 4372 return iter.page.Values()[iter.i] 4373} 4374 4375// Creates a new instance of the StorageListResultIterator type. 4376func NewStorageListResultIterator(page StorageListResultPage) StorageListResultIterator { 4377 return StorageListResultIterator{page: page} 4378} 4379 4380// IsEmpty returns true if the ListResult contains no values. 4381func (slr StorageListResult) IsEmpty() bool { 4382 return slr.Value == nil || len(*slr.Value) == 0 4383} 4384 4385// hasNextLink returns true if the NextLink is not empty. 4386func (slr StorageListResult) hasNextLink() bool { 4387 return slr.NextLink != nil && len(*slr.NextLink) != 0 4388} 4389 4390// storageListResultPreparer prepares a request to retrieve the next set of results. 4391// It returns nil if no more results exist. 4392func (slr StorageListResult) storageListResultPreparer(ctx context.Context) (*http.Request, error) { 4393 if !slr.hasNextLink() { 4394 return nil, nil 4395 } 4396 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4397 autorest.AsJSON(), 4398 autorest.AsGet(), 4399 autorest.WithBaseURL(to.String(slr.NextLink))) 4400} 4401 4402// StorageListResultPage contains a page of StorageAccountItem values. 4403type StorageListResultPage struct { 4404 fn func(context.Context, StorageListResult) (StorageListResult, error) 4405 slr StorageListResult 4406} 4407 4408// NextWithContext advances to the next page of values. If there was an error making 4409// the request the page does not advance and the error is returned. 4410func (page *StorageListResultPage) NextWithContext(ctx context.Context) (err error) { 4411 if tracing.IsEnabled() { 4412 ctx = tracing.StartSpan(ctx, fqdn+"/StorageListResultPage.NextWithContext") 4413 defer func() { 4414 sc := -1 4415 if page.Response().Response.Response != nil { 4416 sc = page.Response().Response.Response.StatusCode 4417 } 4418 tracing.EndSpan(ctx, sc, err) 4419 }() 4420 } 4421 for { 4422 next, err := page.fn(ctx, page.slr) 4423 if err != nil { 4424 return err 4425 } 4426 page.slr = next 4427 if !next.hasNextLink() || !next.IsEmpty() { 4428 break 4429 } 4430 } 4431 return nil 4432} 4433 4434// Next advances to the next page of values. If there was an error making 4435// the request the page does not advance and the error is returned. 4436// Deprecated: Use NextWithContext() instead. 4437func (page *StorageListResultPage) Next() error { 4438 return page.NextWithContext(context.Background()) 4439} 4440 4441// NotDone returns true if the page enumeration should be started or is not yet complete. 4442func (page StorageListResultPage) NotDone() bool { 4443 return !page.slr.IsEmpty() 4444} 4445 4446// Response returns the raw server response from the last page request. 4447func (page StorageListResultPage) Response() StorageListResult { 4448 return page.slr 4449} 4450 4451// Values returns the slice of values for the current page or nil if there are no values. 4452func (page StorageListResultPage) Values() []StorageAccountItem { 4453 if page.slr.IsEmpty() { 4454 return nil 4455 } 4456 return *page.slr.Value 4457} 4458 4459// Creates a new instance of the StorageListResultPage type. 4460func NewStorageListResultPage(cur StorageListResult, getNextPage func(context.Context, StorageListResult) (StorageListResult, error)) StorageListResultPage { 4461 return StorageListResultPage{ 4462 fn: getNextPage, 4463 slr: cur, 4464 } 4465} 4466 4467// StorageRestoreParameters the secret restore parameters. 4468type StorageRestoreParameters struct { 4469 // StorageBundleBackup - The backup blob associated with a storage account. (a URL-encoded base64 string) 4470 StorageBundleBackup *string `json:"value,omitempty"` 4471} 4472 4473// SubjectAlternativeNames the subject alternate names of a X509 object. 4474type SubjectAlternativeNames struct { 4475 // Emails - Email addresses. 4476 Emails *[]string `json:"emails,omitempty"` 4477 // DNSNames - Domain names. 4478 DNSNames *[]string `json:"dns_names,omitempty"` 4479 // Upns - User principal names. 4480 Upns *[]string `json:"upns,omitempty"` 4481} 4482 4483// TransferKey ... 4484type TransferKey struct { 4485 autorest.Response `json:"-"` 4486 // KeyFormat - Specifies the format of the transfer key 4487 KeyFormat *string `json:"key_format,omitempty"` 4488 // TransferKey - Specifies the transfer key in JWK format 4489 TransferKey *SecurityDomainJSONWebKey `json:"transfer_key,omitempty"` 4490} 4491 4492// Trigger a condition to be satisfied for an action to be executed. 4493type Trigger struct { 4494 // LifetimePercentage - Percentage of lifetime at which to trigger. Value should be between 1 and 99. 4495 LifetimePercentage *int32 `json:"lifetime_percentage,omitempty"` 4496 // 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). 4497 DaysBeforeExpiry *int32 `json:"days_before_expiry,omitempty"` 4498} 4499 4500// X509CertificateProperties properties of the X509 component of a certificate. 4501type X509CertificateProperties struct { 4502 // Subject - The subject name. Should be a valid X509 distinguished Name. 4503 Subject *string `json:"subject,omitempty"` 4504 // Ekus - The enhanced key usage. 4505 Ekus *[]string `json:"ekus,omitempty"` 4506 // SubjectAlternativeNames - The subject alternative names. 4507 SubjectAlternativeNames *SubjectAlternativeNames `json:"sans,omitempty"` 4508 // KeyUsage - List of key usages. 4509 KeyUsage *[]KeyUsageType `json:"key_usage,omitempty"` 4510 // ValidityInMonths - The duration that the certificate is valid in months. 4511 ValidityInMonths *int32 `json:"validity_months,omitempty"` 4512} 4513