diff --git a/services/keyvault/mgmt/2018-02-14/keyvault/enums.go b/services/keyvault/mgmt/2018-02-14/keyvault/enums.go new file mode 100644 index 000000000000..32d2d8158bfa --- /dev/null +++ b/services/keyvault/mgmt/2018-02-14/keyvault/enums.go @@ -0,0 +1,305 @@ +package keyvault + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AccessPolicyUpdateKind enumerates the values for access policy update kind. +type AccessPolicyUpdateKind string + +const ( + // Add ... + Add AccessPolicyUpdateKind = "add" + // Remove ... + Remove AccessPolicyUpdateKind = "remove" + // Replace ... + Replace AccessPolicyUpdateKind = "replace" +) + +// PossibleAccessPolicyUpdateKindValues returns an array of possible values for the AccessPolicyUpdateKind const type. +func PossibleAccessPolicyUpdateKindValues() []AccessPolicyUpdateKind { + return []AccessPolicyUpdateKind{Add, Remove, Replace} +} + +// CertificatePermissions enumerates the values for certificate permissions. +type CertificatePermissions string + +const ( + // Backup ... + Backup CertificatePermissions = "backup" + // Create ... + Create CertificatePermissions = "create" + // Delete ... + Delete CertificatePermissions = "delete" + // Deleteissuers ... + Deleteissuers CertificatePermissions = "deleteissuers" + // Get ... + Get CertificatePermissions = "get" + // Getissuers ... + Getissuers CertificatePermissions = "getissuers" + // Import ... + Import CertificatePermissions = "import" + // List ... + List CertificatePermissions = "list" + // Listissuers ... + Listissuers CertificatePermissions = "listissuers" + // Managecontacts ... + Managecontacts CertificatePermissions = "managecontacts" + // Manageissuers ... + Manageissuers CertificatePermissions = "manageissuers" + // Purge ... + Purge CertificatePermissions = "purge" + // Recover ... + Recover CertificatePermissions = "recover" + // Restore ... + Restore CertificatePermissions = "restore" + // Setissuers ... + Setissuers CertificatePermissions = "setissuers" + // Update ... + Update CertificatePermissions = "update" +) + +// PossibleCertificatePermissionsValues returns an array of possible values for the CertificatePermissions const type. +func PossibleCertificatePermissionsValues() []CertificatePermissions { + return []CertificatePermissions{Backup, Create, Delete, Deleteissuers, Get, Getissuers, Import, List, Listissuers, Managecontacts, Manageissuers, Purge, Recover, Restore, Setissuers, Update} +} + +// CreateMode enumerates the values for create mode. +type CreateMode string + +const ( + // CreateModeDefault ... + CreateModeDefault CreateMode = "default" + // CreateModeRecover ... + CreateModeRecover CreateMode = "recover" +) + +// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. +func PossibleCreateModeValues() []CreateMode { + return []CreateMode{CreateModeDefault, CreateModeRecover} +} + +// KeyPermissions enumerates the values for key permissions. +type KeyPermissions string + +const ( + // KeyPermissionsBackup ... + KeyPermissionsBackup KeyPermissions = "backup" + // KeyPermissionsCreate ... + KeyPermissionsCreate KeyPermissions = "create" + // KeyPermissionsDecrypt ... + KeyPermissionsDecrypt KeyPermissions = "decrypt" + // KeyPermissionsDelete ... + KeyPermissionsDelete KeyPermissions = "delete" + // KeyPermissionsEncrypt ... + KeyPermissionsEncrypt KeyPermissions = "encrypt" + // KeyPermissionsGet ... + KeyPermissionsGet KeyPermissions = "get" + // KeyPermissionsImport ... + KeyPermissionsImport KeyPermissions = "import" + // KeyPermissionsList ... + KeyPermissionsList KeyPermissions = "list" + // KeyPermissionsPurge ... + KeyPermissionsPurge KeyPermissions = "purge" + // KeyPermissionsRecover ... + KeyPermissionsRecover KeyPermissions = "recover" + // KeyPermissionsRestore ... + KeyPermissionsRestore KeyPermissions = "restore" + // KeyPermissionsSign ... + KeyPermissionsSign KeyPermissions = "sign" + // KeyPermissionsUnwrapKey ... + KeyPermissionsUnwrapKey KeyPermissions = "unwrapKey" + // KeyPermissionsUpdate ... + KeyPermissionsUpdate KeyPermissions = "update" + // KeyPermissionsVerify ... + KeyPermissionsVerify KeyPermissions = "verify" + // KeyPermissionsWrapKey ... + KeyPermissionsWrapKey KeyPermissions = "wrapKey" +) + +// PossibleKeyPermissionsValues returns an array of possible values for the KeyPermissions const type. +func PossibleKeyPermissionsValues() []KeyPermissions { + return []KeyPermissions{KeyPermissionsBackup, KeyPermissionsCreate, KeyPermissionsDecrypt, KeyPermissionsDelete, KeyPermissionsEncrypt, KeyPermissionsGet, KeyPermissionsImport, KeyPermissionsList, KeyPermissionsPurge, KeyPermissionsRecover, KeyPermissionsRestore, KeyPermissionsSign, KeyPermissionsUnwrapKey, KeyPermissionsUpdate, KeyPermissionsVerify, KeyPermissionsWrapKey} +} + +// NetworkRuleAction enumerates the values for network rule action. +type NetworkRuleAction string + +const ( + // Allow ... + Allow NetworkRuleAction = "Allow" + // Deny ... + Deny NetworkRuleAction = "Deny" +) + +// PossibleNetworkRuleActionValues returns an array of possible values for the NetworkRuleAction const type. +func PossibleNetworkRuleActionValues() []NetworkRuleAction { + return []NetworkRuleAction{Allow, Deny} +} + +// NetworkRuleBypassOptions enumerates the values for network rule bypass options. +type NetworkRuleBypassOptions string + +const ( + // AzureServices ... + AzureServices NetworkRuleBypassOptions = "AzureServices" + // None ... + None NetworkRuleBypassOptions = "None" +) + +// PossibleNetworkRuleBypassOptionsValues returns an array of possible values for the NetworkRuleBypassOptions const type. +func PossibleNetworkRuleBypassOptionsValues() []NetworkRuleBypassOptions { + return []NetworkRuleBypassOptions{AzureServices, None} +} + +// PrivateEndpointConnectionProvisioningState enumerates the values for private endpoint connection +// provisioning state. +type PrivateEndpointConnectionProvisioningState string + +const ( + // Creating ... + Creating PrivateEndpointConnectionProvisioningState = "Creating" + // Deleting ... + Deleting PrivateEndpointConnectionProvisioningState = "Deleting" + // Disconnected ... + Disconnected PrivateEndpointConnectionProvisioningState = "Disconnected" + // Failed ... + Failed PrivateEndpointConnectionProvisioningState = "Failed" + // Succeeded ... + Succeeded PrivateEndpointConnectionProvisioningState = "Succeeded" + // Updating ... + Updating PrivateEndpointConnectionProvisioningState = "Updating" +) + +// PossiblePrivateEndpointConnectionProvisioningStateValues returns an array of possible values for the PrivateEndpointConnectionProvisioningState const type. +func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { + return []PrivateEndpointConnectionProvisioningState{Creating, Deleting, Disconnected, Failed, Succeeded, Updating} +} + +// PrivateEndpointServiceConnectionStatus enumerates the values for private endpoint service connection status. +type PrivateEndpointServiceConnectionStatus string + +const ( + // PrivateEndpointServiceConnectionStatusApproved ... + PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" + // PrivateEndpointServiceConnectionStatusDisconnected ... + PrivateEndpointServiceConnectionStatusDisconnected PrivateEndpointServiceConnectionStatus = "Disconnected" + // PrivateEndpointServiceConnectionStatusPending ... + PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" + // PrivateEndpointServiceConnectionStatusRejected ... + PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" +) + +// PossiblePrivateEndpointServiceConnectionStatusValues returns an array of possible values for the PrivateEndpointServiceConnectionStatus const type. +func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { + return []PrivateEndpointServiceConnectionStatus{PrivateEndpointServiceConnectionStatusApproved, PrivateEndpointServiceConnectionStatusDisconnected, PrivateEndpointServiceConnectionStatusPending, PrivateEndpointServiceConnectionStatusRejected} +} + +// Reason enumerates the values for reason. +type Reason string + +const ( + // AccountNameInvalid ... + AccountNameInvalid Reason = "AccountNameInvalid" + // AlreadyExists ... + AlreadyExists Reason = "AlreadyExists" +) + +// PossibleReasonValues returns an array of possible values for the Reason const type. +func PossibleReasonValues() []Reason { + return []Reason{AccountNameInvalid, AlreadyExists} +} + +// SecretPermissions enumerates the values for secret permissions. +type SecretPermissions string + +const ( + // SecretPermissionsBackup ... + SecretPermissionsBackup SecretPermissions = "backup" + // SecretPermissionsDelete ... + SecretPermissionsDelete SecretPermissions = "delete" + // SecretPermissionsGet ... + SecretPermissionsGet SecretPermissions = "get" + // SecretPermissionsList ... + SecretPermissionsList SecretPermissions = "list" + // SecretPermissionsPurge ... + SecretPermissionsPurge SecretPermissions = "purge" + // SecretPermissionsRecover ... + SecretPermissionsRecover SecretPermissions = "recover" + // SecretPermissionsRestore ... + SecretPermissionsRestore SecretPermissions = "restore" + // SecretPermissionsSet ... + SecretPermissionsSet SecretPermissions = "set" +) + +// PossibleSecretPermissionsValues returns an array of possible values for the SecretPermissions const type. +func PossibleSecretPermissionsValues() []SecretPermissions { + return []SecretPermissions{SecretPermissionsBackup, SecretPermissionsDelete, SecretPermissionsGet, SecretPermissionsList, SecretPermissionsPurge, SecretPermissionsRecover, SecretPermissionsRestore, SecretPermissionsSet} +} + +// SkuName enumerates the values for sku name. +type SkuName string + +const ( + // Premium ... + Premium SkuName = "premium" + // Standard ... + Standard SkuName = "standard" +) + +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{Premium, Standard} +} + +// StoragePermissions enumerates the values for storage permissions. +type StoragePermissions string + +const ( + // StoragePermissionsBackup ... + StoragePermissionsBackup StoragePermissions = "backup" + // StoragePermissionsDelete ... + StoragePermissionsDelete StoragePermissions = "delete" + // StoragePermissionsDeletesas ... + StoragePermissionsDeletesas StoragePermissions = "deletesas" + // StoragePermissionsGet ... + StoragePermissionsGet StoragePermissions = "get" + // StoragePermissionsGetsas ... + StoragePermissionsGetsas StoragePermissions = "getsas" + // StoragePermissionsList ... + StoragePermissionsList StoragePermissions = "list" + // StoragePermissionsListsas ... + StoragePermissionsListsas StoragePermissions = "listsas" + // StoragePermissionsPurge ... + StoragePermissionsPurge StoragePermissions = "purge" + // StoragePermissionsRecover ... + StoragePermissionsRecover StoragePermissions = "recover" + // StoragePermissionsRegeneratekey ... + StoragePermissionsRegeneratekey StoragePermissions = "regeneratekey" + // StoragePermissionsRestore ... + StoragePermissionsRestore StoragePermissions = "restore" + // StoragePermissionsSet ... + StoragePermissionsSet StoragePermissions = "set" + // StoragePermissionsSetsas ... + StoragePermissionsSetsas StoragePermissions = "setsas" + // StoragePermissionsUpdate ... + StoragePermissionsUpdate StoragePermissions = "update" +) + +// PossibleStoragePermissionsValues returns an array of possible values for the StoragePermissions const type. +func PossibleStoragePermissionsValues() []StoragePermissions { + return []StoragePermissions{StoragePermissionsBackup, StoragePermissionsDelete, StoragePermissionsDeletesas, StoragePermissionsGet, StoragePermissionsGetsas, StoragePermissionsList, StoragePermissionsListsas, StoragePermissionsPurge, StoragePermissionsRecover, StoragePermissionsRegeneratekey, StoragePermissionsRestore, StoragePermissionsSet, StoragePermissionsSetsas, StoragePermissionsUpdate} +} diff --git a/services/keyvault/mgmt/2018-02-14/keyvault/models.go b/services/keyvault/mgmt/2018-02-14/keyvault/models.go index 6e439ca37a05..b97146a38086 100644 --- a/services/keyvault/mgmt/2018-02-14/keyvault/models.go +++ b/services/keyvault/mgmt/2018-02-14/keyvault/models.go @@ -32,295 +32,8 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault" -// AccessPolicyUpdateKind enumerates the values for access policy update kind. -type AccessPolicyUpdateKind string - -const ( - // Add ... - Add AccessPolicyUpdateKind = "add" - // Remove ... - Remove AccessPolicyUpdateKind = "remove" - // Replace ... - Replace AccessPolicyUpdateKind = "replace" -) - -// PossibleAccessPolicyUpdateKindValues returns an array of possible values for the AccessPolicyUpdateKind const type. -func PossibleAccessPolicyUpdateKindValues() []AccessPolicyUpdateKind { - return []AccessPolicyUpdateKind{Add, Remove, Replace} -} - -// CertificatePermissions enumerates the values for certificate permissions. -type CertificatePermissions string - -const ( - // Backup ... - Backup CertificatePermissions = "backup" - // Create ... - Create CertificatePermissions = "create" - // Delete ... - Delete CertificatePermissions = "delete" - // Deleteissuers ... - Deleteissuers CertificatePermissions = "deleteissuers" - // Get ... - Get CertificatePermissions = "get" - // Getissuers ... - Getissuers CertificatePermissions = "getissuers" - // Import ... - Import CertificatePermissions = "import" - // List ... - List CertificatePermissions = "list" - // Listissuers ... - Listissuers CertificatePermissions = "listissuers" - // Managecontacts ... - Managecontacts CertificatePermissions = "managecontacts" - // Manageissuers ... - Manageissuers CertificatePermissions = "manageissuers" - // Purge ... - Purge CertificatePermissions = "purge" - // Recover ... - Recover CertificatePermissions = "recover" - // Restore ... - Restore CertificatePermissions = "restore" - // Setissuers ... - Setissuers CertificatePermissions = "setissuers" - // Update ... - Update CertificatePermissions = "update" -) - -// PossibleCertificatePermissionsValues returns an array of possible values for the CertificatePermissions const type. -func PossibleCertificatePermissionsValues() []CertificatePermissions { - return []CertificatePermissions{Backup, Create, Delete, Deleteissuers, Get, Getissuers, Import, List, Listissuers, Managecontacts, Manageissuers, Purge, Recover, Restore, Setissuers, Update} -} - -// CreateMode enumerates the values for create mode. -type CreateMode string - -const ( - // CreateModeDefault ... - CreateModeDefault CreateMode = "default" - // CreateModeRecover ... - CreateModeRecover CreateMode = "recover" -) - -// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. -func PossibleCreateModeValues() []CreateMode { - return []CreateMode{CreateModeDefault, CreateModeRecover} -} - -// KeyPermissions enumerates the values for key permissions. -type KeyPermissions string - -const ( - // KeyPermissionsBackup ... - KeyPermissionsBackup KeyPermissions = "backup" - // KeyPermissionsCreate ... - KeyPermissionsCreate KeyPermissions = "create" - // KeyPermissionsDecrypt ... - KeyPermissionsDecrypt KeyPermissions = "decrypt" - // KeyPermissionsDelete ... - KeyPermissionsDelete KeyPermissions = "delete" - // KeyPermissionsEncrypt ... - KeyPermissionsEncrypt KeyPermissions = "encrypt" - // KeyPermissionsGet ... - KeyPermissionsGet KeyPermissions = "get" - // KeyPermissionsImport ... - KeyPermissionsImport KeyPermissions = "import" - // KeyPermissionsList ... - KeyPermissionsList KeyPermissions = "list" - // KeyPermissionsPurge ... - KeyPermissionsPurge KeyPermissions = "purge" - // KeyPermissionsRecover ... - KeyPermissionsRecover KeyPermissions = "recover" - // KeyPermissionsRestore ... - KeyPermissionsRestore KeyPermissions = "restore" - // KeyPermissionsSign ... - KeyPermissionsSign KeyPermissions = "sign" - // KeyPermissionsUnwrapKey ... - KeyPermissionsUnwrapKey KeyPermissions = "unwrapKey" - // KeyPermissionsUpdate ... - KeyPermissionsUpdate KeyPermissions = "update" - // KeyPermissionsVerify ... - KeyPermissionsVerify KeyPermissions = "verify" - // KeyPermissionsWrapKey ... - KeyPermissionsWrapKey KeyPermissions = "wrapKey" -) - -// PossibleKeyPermissionsValues returns an array of possible values for the KeyPermissions const type. -func PossibleKeyPermissionsValues() []KeyPermissions { - return []KeyPermissions{KeyPermissionsBackup, KeyPermissionsCreate, KeyPermissionsDecrypt, KeyPermissionsDelete, KeyPermissionsEncrypt, KeyPermissionsGet, KeyPermissionsImport, KeyPermissionsList, KeyPermissionsPurge, KeyPermissionsRecover, KeyPermissionsRestore, KeyPermissionsSign, KeyPermissionsUnwrapKey, KeyPermissionsUpdate, KeyPermissionsVerify, KeyPermissionsWrapKey} -} - -// NetworkRuleAction enumerates the values for network rule action. -type NetworkRuleAction string - -const ( - // Allow ... - Allow NetworkRuleAction = "Allow" - // Deny ... - Deny NetworkRuleAction = "Deny" -) - -// PossibleNetworkRuleActionValues returns an array of possible values for the NetworkRuleAction const type. -func PossibleNetworkRuleActionValues() []NetworkRuleAction { - return []NetworkRuleAction{Allow, Deny} -} - -// NetworkRuleBypassOptions enumerates the values for network rule bypass options. -type NetworkRuleBypassOptions string - -const ( - // AzureServices ... - AzureServices NetworkRuleBypassOptions = "AzureServices" - // None ... - None NetworkRuleBypassOptions = "None" -) - -// PossibleNetworkRuleBypassOptionsValues returns an array of possible values for the NetworkRuleBypassOptions const type. -func PossibleNetworkRuleBypassOptionsValues() []NetworkRuleBypassOptions { - return []NetworkRuleBypassOptions{AzureServices, None} -} - -// PrivateEndpointConnectionProvisioningState enumerates the values for private endpoint connection -// provisioning state. -type PrivateEndpointConnectionProvisioningState string - -const ( - // Creating ... - Creating PrivateEndpointConnectionProvisioningState = "Creating" - // Deleting ... - Deleting PrivateEndpointConnectionProvisioningState = "Deleting" - // Disconnected ... - Disconnected PrivateEndpointConnectionProvisioningState = "Disconnected" - // Failed ... - Failed PrivateEndpointConnectionProvisioningState = "Failed" - // Succeeded ... - Succeeded PrivateEndpointConnectionProvisioningState = "Succeeded" - // Updating ... - Updating PrivateEndpointConnectionProvisioningState = "Updating" -) - -// PossiblePrivateEndpointConnectionProvisioningStateValues returns an array of possible values for the PrivateEndpointConnectionProvisioningState const type. -func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { - return []PrivateEndpointConnectionProvisioningState{Creating, Deleting, Disconnected, Failed, Succeeded, Updating} -} - -// PrivateEndpointServiceConnectionStatus enumerates the values for private endpoint service connection status. -type PrivateEndpointServiceConnectionStatus string - -const ( - // PrivateEndpointServiceConnectionStatusApproved ... - PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" - // PrivateEndpointServiceConnectionStatusDisconnected ... - PrivateEndpointServiceConnectionStatusDisconnected PrivateEndpointServiceConnectionStatus = "Disconnected" - // PrivateEndpointServiceConnectionStatusPending ... - PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" - // PrivateEndpointServiceConnectionStatusRejected ... - PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" -) - -// PossiblePrivateEndpointServiceConnectionStatusValues returns an array of possible values for the PrivateEndpointServiceConnectionStatus const type. -func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { - return []PrivateEndpointServiceConnectionStatus{PrivateEndpointServiceConnectionStatusApproved, PrivateEndpointServiceConnectionStatusDisconnected, PrivateEndpointServiceConnectionStatusPending, PrivateEndpointServiceConnectionStatusRejected} -} - -// Reason enumerates the values for reason. -type Reason string - -const ( - // AccountNameInvalid ... - AccountNameInvalid Reason = "AccountNameInvalid" - // AlreadyExists ... - AlreadyExists Reason = "AlreadyExists" -) - -// PossibleReasonValues returns an array of possible values for the Reason const type. -func PossibleReasonValues() []Reason { - return []Reason{AccountNameInvalid, AlreadyExists} -} - -// SecretPermissions enumerates the values for secret permissions. -type SecretPermissions string - -const ( - // SecretPermissionsBackup ... - SecretPermissionsBackup SecretPermissions = "backup" - // SecretPermissionsDelete ... - SecretPermissionsDelete SecretPermissions = "delete" - // SecretPermissionsGet ... - SecretPermissionsGet SecretPermissions = "get" - // SecretPermissionsList ... - SecretPermissionsList SecretPermissions = "list" - // SecretPermissionsPurge ... - SecretPermissionsPurge SecretPermissions = "purge" - // SecretPermissionsRecover ... - SecretPermissionsRecover SecretPermissions = "recover" - // SecretPermissionsRestore ... - SecretPermissionsRestore SecretPermissions = "restore" - // SecretPermissionsSet ... - SecretPermissionsSet SecretPermissions = "set" -) - -// PossibleSecretPermissionsValues returns an array of possible values for the SecretPermissions const type. -func PossibleSecretPermissionsValues() []SecretPermissions { - return []SecretPermissions{SecretPermissionsBackup, SecretPermissionsDelete, SecretPermissionsGet, SecretPermissionsList, SecretPermissionsPurge, SecretPermissionsRecover, SecretPermissionsRestore, SecretPermissionsSet} -} - -// SkuName enumerates the values for sku name. -type SkuName string - -const ( - // Premium ... - Premium SkuName = "premium" - // Standard ... - Standard SkuName = "standard" -) - -// PossibleSkuNameValues returns an array of possible values for the SkuName const type. -func PossibleSkuNameValues() []SkuName { - return []SkuName{Premium, Standard} -} - -// StoragePermissions enumerates the values for storage permissions. -type StoragePermissions string - -const ( - // StoragePermissionsBackup ... - StoragePermissionsBackup StoragePermissions = "backup" - // StoragePermissionsDelete ... - StoragePermissionsDelete StoragePermissions = "delete" - // StoragePermissionsDeletesas ... - StoragePermissionsDeletesas StoragePermissions = "deletesas" - // StoragePermissionsGet ... - StoragePermissionsGet StoragePermissions = "get" - // StoragePermissionsGetsas ... - StoragePermissionsGetsas StoragePermissions = "getsas" - // StoragePermissionsList ... - StoragePermissionsList StoragePermissions = "list" - // StoragePermissionsListsas ... - StoragePermissionsListsas StoragePermissions = "listsas" - // StoragePermissionsPurge ... - StoragePermissionsPurge StoragePermissions = "purge" - // StoragePermissionsRecover ... - StoragePermissionsRecover StoragePermissions = "recover" - // StoragePermissionsRegeneratekey ... - StoragePermissionsRegeneratekey StoragePermissions = "regeneratekey" - // StoragePermissionsRestore ... - StoragePermissionsRestore StoragePermissions = "restore" - // StoragePermissionsSet ... - StoragePermissionsSet StoragePermissions = "set" - // StoragePermissionsSetsas ... - StoragePermissionsSetsas StoragePermissions = "setsas" - // StoragePermissionsUpdate ... - StoragePermissionsUpdate StoragePermissions = "update" -) - -// PossibleStoragePermissionsValues returns an array of possible values for the StoragePermissions const type. -func PossibleStoragePermissionsValues() []StoragePermissions { - return []StoragePermissions{StoragePermissionsBackup, StoragePermissionsDelete, StoragePermissionsDeletesas, StoragePermissionsGet, StoragePermissionsGetsas, StoragePermissionsList, StoragePermissionsListsas, StoragePermissionsPurge, StoragePermissionsRecover, StoragePermissionsRegeneratekey, StoragePermissionsRestore, StoragePermissionsSet, StoragePermissionsSetsas, StoragePermissionsUpdate} -} - -// AccessPolicyEntry an identity that have access to the key vault. All identities in the array must use -// the same tenant ID as the key vault's tenant ID. +// AccessPolicyEntry an identity that have access to the key vault. All identities in the array must use the +// same tenant ID as the key vault's tenant ID. type AccessPolicyEntry struct { // TenantID - The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. TenantID *uuid.UUID `json:"tenantId,omitempty"` @@ -369,6 +82,15 @@ type DeletedVault struct { Properties *DeletedVaultProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for DeletedVault. +func (dv DeletedVault) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dv.Properties != nil { + objectMap["properties"] = dv.Properties + } + return json.Marshal(objectMap) +} + // DeletedVaultListResult list of vaults type DeletedVaultListResult struct { autorest.Response `json:"-"` @@ -446,10 +168,15 @@ func (dvlr DeletedVaultListResult) IsEmpty() bool { return dvlr.Value == nil || len(*dvlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dvlr DeletedVaultListResult) hasNextLink() bool { + return dvlr.NextLink != nil && len(*dvlr.NextLink) != 0 +} + // deletedVaultListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dvlr DeletedVaultListResult) deletedVaultListResultPreparer(ctx context.Context) (*http.Request, error) { - if dvlr.NextLink == nil || len(to.String(dvlr.NextLink)) < 1 { + if !dvlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -477,11 +204,16 @@ func (page *DeletedVaultListResultPage) NextWithContext(ctx context.Context) (er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dvlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dvlr) + if err != nil { + return err + } + page.dvlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dvlr = next return nil } @@ -656,8 +388,8 @@ type OperationDisplay struct { Description *string `json:"description,omitempty"` } -// OperationListResult result of the request to list Storage operations. It contains a list of operations -// and a URL link to get the next set of results. +// OperationListResult result of the request to list Storage operations. It contains a list of operations and a +// URL link to get the next set of results. type OperationListResult struct { autorest.Response `json:"-"` // Value - List of Storage operations supported by the Storage resource provider. @@ -734,10 +466,15 @@ func (olr OperationListResult) IsEmpty() bool { return olr.Value == nil || len(*olr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (olr OperationListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + // operationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { - if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + if !olr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -765,11 +502,16 @@ func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.olr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.olr = next return nil } @@ -1111,6 +853,15 @@ type PrivateLinkResourceProperties struct { RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` } +// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. +func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plrp.RequiredZoneNames != nil { + objectMap["requiredZoneNames"] = plrp.RequiredZoneNames + } + return json.Marshal(objectMap) +} + // PrivateLinkServiceConnectionState an object that represents the approval state of the private link // connection. type PrivateLinkServiceConnectionState struct { @@ -1219,10 +970,15 @@ func (rlr ResourceListResult) IsEmpty() bool { return rlr.Value == nil || len(*rlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rlr ResourceListResult) hasNextLink() bool { + return rlr.NextLink != nil && len(*rlr.NextLink) != 0 +} + // resourceListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rlr ResourceListResult) resourceListResultPreparer(ctx context.Context) (*http.Request, error) { - if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { + if !rlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1250,11 +1006,16 @@ func (page *ResourceListResultPage) NextWithContext(ctx context.Context) (err er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rlr) + if err != nil { + return err + } + page.rlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rlr = next return nil } @@ -1349,6 +1110,15 @@ type VaultAccessPolicyParameters struct { Properties *VaultAccessPolicyProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for VaultAccessPolicyParameters. +func (vapp VaultAccessPolicyParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vapp.Properties != nil { + objectMap["properties"] = vapp.Properties + } + return json.Marshal(objectMap) +} + // VaultAccessPolicyProperties properties of the vault access policy type VaultAccessPolicyProperties struct { // AccessPolicies - An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID. @@ -1465,10 +1235,15 @@ func (vlr VaultListResult) IsEmpty() bool { return vlr.Value == nil || len(*vlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vlr VaultListResult) hasNextLink() bool { + return vlr.NextLink != nil && len(*vlr.NextLink) != 0 +} + // vaultListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vlr VaultListResult) vaultListResultPreparer(ctx context.Context) (*http.Request, error) { - if vlr.NextLink == nil || len(to.String(vlr.NextLink)) < 1 { + if !vlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1496,11 +1271,16 @@ func (page *VaultListResultPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vlr) + if err != nil { + return err + } + page.vlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vlr = next return nil } @@ -1560,7 +1340,7 @@ type VaultPatchProperties struct { TenantID *uuid.UUID `json:"tenantId,omitempty"` // Sku - SKU details Sku *Sku `json:"sku,omitempty"` - // AccessPolicies - An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID. + // AccessPolicies - An array of 0 to 1024 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID. AccessPolicies *[]AccessPolicyEntry `json:"accessPolicies,omitempty"` // EnabledForDeployment - Property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key vault. EnabledForDeployment *bool `json:"enabledForDeployment,omitempty"` @@ -1606,6 +1386,45 @@ type VaultProperties struct { PrivateEndpointConnections *[]PrivateEndpointConnectionItem `json:"privateEndpointConnections,omitempty"` } +// MarshalJSON is the custom marshaler for VaultProperties. +func (vp VaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vp.TenantID != nil { + objectMap["tenantId"] = vp.TenantID + } + if vp.Sku != nil { + objectMap["sku"] = vp.Sku + } + if vp.AccessPolicies != nil { + objectMap["accessPolicies"] = vp.AccessPolicies + } + if vp.VaultURI != nil { + objectMap["vaultUri"] = vp.VaultURI + } + if vp.EnabledForDeployment != nil { + objectMap["enabledForDeployment"] = vp.EnabledForDeployment + } + if vp.EnabledForDiskEncryption != nil { + objectMap["enabledForDiskEncryption"] = vp.EnabledForDiskEncryption + } + if vp.EnabledForTemplateDeployment != nil { + objectMap["enabledForTemplateDeployment"] = vp.EnabledForTemplateDeployment + } + if vp.EnableSoftDelete != nil { + objectMap["enableSoftDelete"] = vp.EnableSoftDelete + } + if vp.CreateMode != "" { + objectMap["createMode"] = vp.CreateMode + } + if vp.EnablePurgeProtection != nil { + objectMap["enablePurgeProtection"] = vp.EnablePurgeProtection + } + if vp.NetworkAcls != nil { + objectMap["networkAcls"] = vp.NetworkAcls + } + return json.Marshal(objectMap) +} + // VaultsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VaultsCreateOrUpdateFuture struct { diff --git a/services/keyvault/mgmt/2018-02-14/keyvault/operations.go b/services/keyvault/mgmt/2018-02-14/keyvault/operations.go index 7f67a04c35ae..3c01c5720b74 100644 --- a/services/keyvault/mgmt/2018-02-14/keyvault/operations.go +++ b/services/keyvault/mgmt/2018-02-14/keyvault/operations.go @@ -72,6 +72,9 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe if err != nil { err = autorest.NewErrorWithError(err, "keyvault.OperationsClient", "List", resp, "Failure responding to request") } + if result.olr.hasNextLink() && result.olr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } diff --git a/services/keyvault/mgmt/2018-02-14/keyvault/vaults.go b/services/keyvault/mgmt/2018-02-14/keyvault/vaults.go index e9f71337d822..201e384a1b8c 100644 --- a/services/keyvault/mgmt/2018-02-14/keyvault/vaults.go +++ b/services/keyvault/mgmt/2018-02-14/keyvault/vaults.go @@ -471,6 +471,9 @@ func (client VaultsClient) List(ctx context.Context, top *int32) (result Resourc if err != nil { err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "List", resp, "Failure responding to request") } + if result.rlr.hasNextLink() && result.rlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -587,6 +590,9 @@ func (client VaultsClient) ListByResourceGroup(ctx context.Context, resourceGrou if err != nil { err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.vlr.hasNextLink() && result.vlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -701,6 +707,9 @@ func (client VaultsClient) ListBySubscription(ctx context.Context, top *int32) ( if err != nil { err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "ListBySubscription", resp, "Failure responding to request") } + if result.vlr.hasNextLink() && result.vlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -812,6 +821,9 @@ func (client VaultsClient) ListDeleted(ctx context.Context) (result DeletedVault if err != nil { err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "ListDeleted", resp, "Failure responding to request") } + if result.dvlr.hasNextLink() && result.dvlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return }