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