diff --git a/services/keyvault/2016-10-01/keyvault/CHANGELOG.md b/services/keyvault/2016-10-01/keyvault/CHANGELOG.md new file mode 100644 index 000000000000..d44f5b70a167 --- /dev/null +++ b/services/keyvault/2016-10-01/keyvault/CHANGELOG.md @@ -0,0 +1,29 @@ +Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82 + +Code generator @microsoft.azure/autorest.go@~2.1.161 + +## Breaking Changes + +- Function `NewKeyListResultPage` parameter(s) have been changed from `(func(context.Context, KeyListResult) (KeyListResult, error))` to `(KeyListResult, func(context.Context, KeyListResult) (KeyListResult, error))` +- Function `NewSasDefinitionListResultPage` parameter(s) have been changed from `(func(context.Context, SasDefinitionListResult) (SasDefinitionListResult, error))` to `(SasDefinitionListResult, func(context.Context, SasDefinitionListResult) (SasDefinitionListResult, error))` +- Function `NewSecretListResultPage` parameter(s) have been changed from `(func(context.Context, SecretListResult) (SecretListResult, error))` to `(SecretListResult, func(context.Context, SecretListResult) (SecretListResult, error))` +- Function `NewStorageListResultPage` parameter(s) have been changed from `(func(context.Context, StorageListResult) (StorageListResult, error))` to `(StorageListResult, func(context.Context, StorageListResult) (StorageListResult, error))` +- Function `NewDeletedCertificateListResultPage` parameter(s) have been changed from `(func(context.Context, DeletedCertificateListResult) (DeletedCertificateListResult, error))` to `(DeletedCertificateListResult, func(context.Context, DeletedCertificateListResult) (DeletedCertificateListResult, error))` +- Function `NewCertificateListResultPage` parameter(s) have been changed from `(func(context.Context, CertificateListResult) (CertificateListResult, error))` to `(CertificateListResult, func(context.Context, CertificateListResult) (CertificateListResult, error))` +- Function `NewDeletedSecretListResultPage` parameter(s) have been changed from `(func(context.Context, DeletedSecretListResult) (DeletedSecretListResult, error))` to `(DeletedSecretListResult, func(context.Context, DeletedSecretListResult) (DeletedSecretListResult, error))` +- Function `NewCertificateIssuerListResultPage` parameter(s) have been changed from `(func(context.Context, CertificateIssuerListResult) (CertificateIssuerListResult, error))` to `(CertificateIssuerListResult, func(context.Context, CertificateIssuerListResult) (CertificateIssuerListResult, error))` +- Function `NewDeletedKeyListResultPage` parameter(s) have been changed from `(func(context.Context, DeletedKeyListResult) (DeletedKeyListResult, error))` to `(DeletedKeyListResult, func(context.Context, DeletedKeyListResult) (DeletedKeyListResult, error))` + +## New Content + +- New function `SasDefinitionAttributes.MarshalJSON() ([]byte, error)` +- New function `CertificateOperation.MarshalJSON() ([]byte, error)` +- New function `StorageAccountAttributes.MarshalJSON() ([]byte, error)` +- New function `Attributes.MarshalJSON() ([]byte, error)` +- New function `IssuerAttributes.MarshalJSON() ([]byte, error)` +- New function `SecretAttributes.MarshalJSON() ([]byte, error)` +- New function `KeyAttributes.MarshalJSON() ([]byte, error)` +- New function `CertificateAttributes.MarshalJSON() ([]byte, error)` +- New function `CertificatePolicy.MarshalJSON() ([]byte, error)` +- New function `Contacts.MarshalJSON() ([]byte, error)` +- New function `IssuerBundle.MarshalJSON() ([]byte, error)` diff --git a/services/keyvault/2016-10-01/keyvault/client.go b/services/keyvault/2016-10-01/keyvault/client.go index 628cfd845aea..6a14943e4322 100644 --- a/services/keyvault/2016-10-01/keyvault/client.go +++ b/services/keyvault/2016-10-01/keyvault/client.go @@ -124,7 +124,6 @@ func (client BaseClient) BackupKeySender(req *http.Request) (*http.Response, err func (client BaseClient) BackupKeyResponder(resp *http.Response) (result BackupKeyResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -203,7 +202,6 @@ func (client BaseClient) BackupSecretSender(req *http.Request) (*http.Response, func (client BaseClient) BackupSecretResponder(resp *http.Response) (result BackupSecretResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -298,7 +296,6 @@ func (client BaseClient) CreateCertificateSender(req *http.Request) (*http.Respo func (client BaseClient) CreateCertificateResponder(resp *http.Response) (result CertificateOperation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -386,7 +383,6 @@ func (client BaseClient) CreateKeySender(req *http.Request) (*http.Response, err func (client BaseClient) CreateKeyResponder(resp *http.Response) (result KeyBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -479,7 +475,6 @@ func (client BaseClient) DecryptSender(req *http.Request) (*http.Response, error func (client BaseClient) DecryptResponder(resp *http.Response) (result KeyOperationResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -559,7 +554,6 @@ func (client BaseClient) DeleteCertificateSender(req *http.Request) (*http.Respo func (client BaseClient) DeleteCertificateResponder(resp *http.Response) (result DeletedCertificateBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -633,7 +627,6 @@ func (client BaseClient) DeleteCertificateContactsSender(req *http.Request) (*ht func (client BaseClient) DeleteCertificateContactsResponder(resp *http.Response) (result Contacts, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -712,7 +705,6 @@ func (client BaseClient) DeleteCertificateIssuerSender(req *http.Request) (*http func (client BaseClient) DeleteCertificateIssuerResponder(resp *http.Response) (result IssuerBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -791,7 +783,6 @@ func (client BaseClient) DeleteCertificateOperationSender(req *http.Request) (*h func (client BaseClient) DeleteCertificateOperationResponder(resp *http.Response) (result CertificateOperation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -871,7 +862,6 @@ func (client BaseClient) DeleteKeySender(req *http.Request) (*http.Response, err func (client BaseClient) DeleteKeyResponder(resp *http.Response) (result DeletedKeyBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -960,7 +950,6 @@ func (client BaseClient) DeleteSasDefinitionSender(req *http.Request) (*http.Res func (client BaseClient) DeleteSasDefinitionResponder(resp *http.Response) (result SasDefinitionBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1039,7 +1028,6 @@ func (client BaseClient) DeleteSecretSender(req *http.Request) (*http.Response, func (client BaseClient) DeleteSecretResponder(resp *http.Response) (result DeletedSecretBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1123,7 +1111,6 @@ func (client BaseClient) DeleteStorageAccountSender(req *http.Request) (*http.Re func (client BaseClient) DeleteStorageAccountResponder(resp *http.Response) (result StorageBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1218,7 +1205,6 @@ func (client BaseClient) EncryptSender(req *http.Request) (*http.Response, error func (client BaseClient) EncryptResponder(resp *http.Response) (result KeyOperationResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1299,7 +1285,6 @@ func (client BaseClient) GetCertificateSender(req *http.Request) (*http.Response func (client BaseClient) GetCertificateResponder(resp *http.Response) (result CertificateBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1373,7 +1358,6 @@ func (client BaseClient) GetCertificateContactsSender(req *http.Request) (*http. func (client BaseClient) GetCertificateContactsResponder(resp *http.Response) (result Contacts, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1452,7 +1436,6 @@ func (client BaseClient) GetCertificateIssuerSender(req *http.Request) (*http.Re func (client BaseClient) GetCertificateIssuerResponder(resp *http.Response) (result IssuerBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1504,6 +1487,9 @@ func (client BaseClient) GetCertificateIssuers(ctx context.Context, vaultBaseURL if err != nil { err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateIssuers", resp, "Failure responding to request") } + if result.cilr.hasNextLink() && result.cilr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -1541,7 +1527,6 @@ func (client BaseClient) GetCertificateIssuersSender(req *http.Request) (*http.R func (client BaseClient) GetCertificateIssuersResponder(resp *http.Response) (result CertificateIssuerListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1657,7 +1642,6 @@ func (client BaseClient) GetCertificateOperationSender(req *http.Request) (*http func (client BaseClient) GetCertificateOperationResponder(resp *http.Response) (result CertificateOperation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1736,7 +1720,6 @@ func (client BaseClient) GetCertificatePolicySender(req *http.Request) (*http.Re func (client BaseClient) GetCertificatePolicyResponder(resp *http.Response) (result CertificatePolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1788,6 +1771,9 @@ func (client BaseClient) GetCertificates(ctx context.Context, vaultBaseURL strin if err != nil { err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificates", resp, "Failure responding to request") } + if result.clr.hasNextLink() && result.clr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -1825,7 +1811,6 @@ func (client BaseClient) GetCertificatesSender(req *http.Request) (*http.Respons func (client BaseClient) GetCertificatesResponder(resp *http.Response) (result CertificateListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1915,6 +1900,9 @@ func (client BaseClient) GetCertificateVersions(ctx context.Context, vaultBaseUR if err != nil { err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateVersions", resp, "Failure responding to request") } + if result.clr.hasNextLink() && result.clr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -1956,7 +1944,6 @@ func (client BaseClient) GetCertificateVersionsSender(req *http.Request) (*http. func (client BaseClient) GetCertificateVersionsResponder(resp *http.Response) (result CertificateListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -2073,7 +2060,6 @@ func (client BaseClient) GetDeletedCertificateSender(req *http.Request) (*http.R func (client BaseClient) GetDeletedCertificateResponder(resp *http.Response) (result DeletedCertificateBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -2127,6 +2113,9 @@ func (client BaseClient) GetDeletedCertificates(ctx context.Context, vaultBaseUR if err != nil { err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedCertificates", resp, "Failure responding to request") } + if result.dclr.hasNextLink() && result.dclr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -2164,7 +2153,6 @@ func (client BaseClient) GetDeletedCertificatesSender(req *http.Request) (*http. func (client BaseClient) GetDeletedCertificatesResponder(resp *http.Response) (result DeletedCertificateListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -2281,7 +2269,6 @@ func (client BaseClient) GetDeletedKeySender(req *http.Request) (*http.Response, func (client BaseClient) GetDeletedKeyResponder(resp *http.Response) (result DeletedKeyBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -2335,6 +2322,9 @@ func (client BaseClient) GetDeletedKeys(ctx context.Context, vaultBaseURL string if err != nil { err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedKeys", resp, "Failure responding to request") } + if result.dklr.hasNextLink() && result.dklr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -2372,7 +2362,6 @@ func (client BaseClient) GetDeletedKeysSender(req *http.Request) (*http.Response func (client BaseClient) GetDeletedKeysResponder(resp *http.Response) (result DeletedKeyListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -2488,7 +2477,6 @@ func (client BaseClient) GetDeletedSecretSender(req *http.Request) (*http.Respon func (client BaseClient) GetDeletedSecretResponder(resp *http.Response) (result DeletedSecretBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -2540,6 +2528,9 @@ func (client BaseClient) GetDeletedSecrets(ctx context.Context, vaultBaseURL str if err != nil { err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSecrets", resp, "Failure responding to request") } + if result.dslr.hasNextLink() && result.dslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -2577,7 +2568,6 @@ func (client BaseClient) GetDeletedSecretsSender(req *http.Request) (*http.Respo func (client BaseClient) GetDeletedSecretsResponder(resp *http.Response) (result DeletedSecretListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -2695,7 +2685,6 @@ func (client BaseClient) GetKeySender(req *http.Request) (*http.Response, error) func (client BaseClient) GetKeyResponder(resp *http.Response) (result KeyBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -2749,6 +2738,9 @@ func (client BaseClient) GetKeys(ctx context.Context, vaultBaseURL string, maxre if err != nil { err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKeys", resp, "Failure responding to request") } + if result.klr.hasNextLink() && result.klr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -2786,7 +2778,6 @@ func (client BaseClient) GetKeysSender(req *http.Request) (*http.Response, error func (client BaseClient) GetKeysResponder(resp *http.Response) (result KeyListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -2876,6 +2867,9 @@ func (client BaseClient) GetKeyVersions(ctx context.Context, vaultBaseURL string if err != nil { err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKeyVersions", resp, "Failure responding to request") } + if result.klr.hasNextLink() && result.klr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -2917,7 +2911,6 @@ func (client BaseClient) GetKeyVersionsSender(req *http.Request) (*http.Response func (client BaseClient) GetKeyVersionsResponder(resp *http.Response) (result KeyListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -3043,7 +3036,6 @@ func (client BaseClient) GetSasDefinitionSender(req *http.Request) (*http.Respon func (client BaseClient) GetSasDefinitionResponder(resp *http.Response) (result SasDefinitionBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -3098,6 +3090,9 @@ func (client BaseClient) GetSasDefinitions(ctx context.Context, vaultBaseURL str if err != nil { err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSasDefinitions", resp, "Failure responding to request") } + if result.sdlr.hasNextLink() && result.sdlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -3139,7 +3134,6 @@ func (client BaseClient) GetSasDefinitionsSender(req *http.Request) (*http.Respo func (client BaseClient) GetSasDefinitionsResponder(resp *http.Response) (result SasDefinitionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -3257,7 +3251,6 @@ func (client BaseClient) GetSecretSender(req *http.Request) (*http.Response, err func (client BaseClient) GetSecretResponder(resp *http.Response) (result SecretBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -3310,6 +3303,9 @@ func (client BaseClient) GetSecrets(ctx context.Context, vaultBaseURL string, ma if err != nil { err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecrets", resp, "Failure responding to request") } + if result.slr.hasNextLink() && result.slr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -3347,7 +3343,6 @@ func (client BaseClient) GetSecretsSender(req *http.Request) (*http.Response, er func (client BaseClient) GetSecretsResponder(resp *http.Response) (result SecretListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -3437,6 +3432,9 @@ func (client BaseClient) GetSecretVersions(ctx context.Context, vaultBaseURL str if err != nil { err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecretVersions", resp, "Failure responding to request") } + if result.slr.hasNextLink() && result.slr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -3478,7 +3476,6 @@ func (client BaseClient) GetSecretVersionsSender(req *http.Request) (*http.Respo func (client BaseClient) GetSecretVersionsResponder(resp *http.Response) (result SecretListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -3600,7 +3597,6 @@ func (client BaseClient) GetStorageAccountSender(req *http.Request) (*http.Respo func (client BaseClient) GetStorageAccountResponder(resp *http.Response) (result StorageBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -3652,6 +3648,9 @@ func (client BaseClient) GetStorageAccounts(ctx context.Context, vaultBaseURL st if err != nil { err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetStorageAccounts", resp, "Failure responding to request") } + if result.slr.hasNextLink() && result.slr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -3689,7 +3688,6 @@ func (client BaseClient) GetStorageAccountsSender(req *http.Request) (*http.Resp func (client BaseClient) GetStorageAccountsResponder(resp *http.Response) (result StorageListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -3823,7 +3821,6 @@ func (client BaseClient) ImportCertificateSender(req *http.Request) (*http.Respo func (client BaseClient) ImportCertificateResponder(resp *http.Response) (result CertificateBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -3914,7 +3911,6 @@ func (client BaseClient) ImportKeySender(req *http.Request) (*http.Response, err func (client BaseClient) ImportKeyResponder(resp *http.Response) (result KeyBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -4002,7 +3998,6 @@ func (client BaseClient) MergeCertificateSender(req *http.Request) (*http.Respon func (client BaseClient) MergeCertificateResponder(resp *http.Response) (result CertificateBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -4082,7 +4077,6 @@ func (client BaseClient) PurgeDeletedCertificateSender(req *http.Request) (*http func (client BaseClient) PurgeDeletedCertificateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -4161,7 +4155,6 @@ func (client BaseClient) PurgeDeletedKeySender(req *http.Request) (*http.Respons func (client BaseClient) PurgeDeletedKeyResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -4240,7 +4233,6 @@ func (client BaseClient) PurgeDeletedSecretSender(req *http.Request) (*http.Resp func (client BaseClient) PurgeDeletedSecretResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -4319,7 +4311,6 @@ func (client BaseClient) RecoverDeletedCertificateSender(req *http.Request) (*ht func (client BaseClient) RecoverDeletedCertificateResponder(resp *http.Response) (result CertificateBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -4400,7 +4391,6 @@ func (client BaseClient) RecoverDeletedKeySender(req *http.Request) (*http.Respo func (client BaseClient) RecoverDeletedKeyResponder(resp *http.Response) (result KeyBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -4479,7 +4469,6 @@ func (client BaseClient) RecoverDeletedSecretSender(req *http.Request) (*http.Re func (client BaseClient) RecoverDeletedSecretResponder(resp *http.Response) (result SecretBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -4569,7 +4558,6 @@ func (client BaseClient) RegenerateStorageAccountKeySender(req *http.Request) (* func (client BaseClient) RegenerateStorageAccountKeyResponder(resp *http.Response) (result StorageBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -4659,7 +4647,6 @@ func (client BaseClient) RestoreKeySender(req *http.Request) (*http.Response, er func (client BaseClient) RestoreKeyResponder(resp *http.Response) (result KeyBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -4742,7 +4729,6 @@ func (client BaseClient) RestoreSecretSender(req *http.Request) (*http.Response, func (client BaseClient) RestoreSecretResponder(resp *http.Response) (result SecretBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -4820,7 +4806,6 @@ func (client BaseClient) SetCertificateContactsSender(req *http.Request) (*http. func (client BaseClient) SetCertificateContactsResponder(resp *http.Response) (result Contacts, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -4908,7 +4893,6 @@ func (client BaseClient) SetCertificateIssuerSender(req *http.Request) (*http.Re func (client BaseClient) SetCertificateIssuerResponder(resp *http.Response) (result IssuerBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -5002,7 +4986,6 @@ func (client BaseClient) SetSasDefinitionSender(req *http.Request) (*http.Respon func (client BaseClient) SetSasDefinitionResponder(resp *http.Response) (result SasDefinitionBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -5092,7 +5075,6 @@ func (client BaseClient) SetSecretSender(req *http.Request) (*http.Response, err func (client BaseClient) SetSecretResponder(resp *http.Response) (result SecretBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -5183,7 +5165,6 @@ func (client BaseClient) SetStorageAccountSender(req *http.Request) (*http.Respo func (client BaseClient) SetStorageAccountResponder(resp *http.Response) (result StorageBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -5273,7 +5254,6 @@ func (client BaseClient) SignSender(req *http.Request) (*http.Response, error) { func (client BaseClient) SignResponder(resp *http.Response) (result KeyOperationResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -5365,7 +5345,6 @@ func (client BaseClient) UnwrapKeySender(req *http.Request) (*http.Response, err func (client BaseClient) UnwrapKeyResponder(resp *http.Response) (result KeyOperationResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -5449,7 +5428,6 @@ func (client BaseClient) UpdateCertificateSender(req *http.Request) (*http.Respo func (client BaseClient) UpdateCertificateResponder(resp *http.Response) (result CertificateBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -5531,7 +5509,6 @@ func (client BaseClient) UpdateCertificateIssuerSender(req *http.Request) (*http func (client BaseClient) UpdateCertificateIssuerResponder(resp *http.Response) (result IssuerBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -5613,7 +5590,6 @@ func (client BaseClient) UpdateCertificateOperationSender(req *http.Request) (*h func (client BaseClient) UpdateCertificateOperationResponder(resp *http.Response) (result CertificateOperation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -5696,7 +5672,6 @@ func (client BaseClient) UpdateCertificatePolicySender(req *http.Request) (*http func (client BaseClient) UpdateCertificatePolicyResponder(resp *http.Response) (result CertificatePolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -5780,7 +5755,6 @@ func (client BaseClient) UpdateKeySender(req *http.Request) (*http.Response, err func (client BaseClient) UpdateKeyResponder(resp *http.Response) (result KeyBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -5872,7 +5846,6 @@ func (client BaseClient) UpdateSasDefinitionSender(req *http.Request) (*http.Res func (client BaseClient) UpdateSasDefinitionResponder(resp *http.Response) (result SasDefinitionBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -5957,7 +5930,6 @@ func (client BaseClient) UpdateSecretSender(req *http.Request) (*http.Response, func (client BaseClient) UpdateSecretResponder(resp *http.Response) (result SecretBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -6045,7 +6017,6 @@ func (client BaseClient) UpdateStorageAccountSender(req *http.Request) (*http.Re func (client BaseClient) UpdateStorageAccountResponder(resp *http.Response) (result StorageBundle, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -6138,7 +6109,6 @@ func (client BaseClient) VerifySender(req *http.Request) (*http.Response, error) func (client BaseClient) VerifyResponder(resp *http.Response) (result KeyVerifyResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -6231,7 +6201,6 @@ func (client BaseClient) WrapKeySender(req *http.Request) (*http.Response, error func (client BaseClient) WrapKeyResponder(resp *http.Response) (result KeyOperationResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/keyvault/2016-10-01/keyvault/enums.go b/services/keyvault/2016-10-01/keyvault/enums.go new file mode 100644 index 000000000000..91b3bf8613f2 --- /dev/null +++ b/services/keyvault/2016-10-01/keyvault/enums.go @@ -0,0 +1,198 @@ +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. + +// ActionType enumerates the values for action type. +type ActionType string + +const ( + // AutoRenew ... + AutoRenew ActionType = "AutoRenew" + // EmailContacts ... + EmailContacts ActionType = "EmailContacts" +) + +// PossibleActionTypeValues returns an array of possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{AutoRenew, EmailContacts} +} + +// DeletionRecoveryLevel enumerates the values for deletion recovery level. +type DeletionRecoveryLevel string + +const ( + // Purgeable Soft-delete is not enabled for this vault. A DELETE operation results in immediate and + // irreversible data loss. + Purgeable DeletionRecoveryLevel = "Purgeable" + // Recoverable Soft-delete is enabled for this vault and purge has been disabled. A deleted entity will + // remain in this state until recovered, or the end of the retention interval. + Recoverable DeletionRecoveryLevel = "Recoverable" + // RecoverableProtectedSubscription Soft-delete is enabled for this vault, and the subscription is + // protected against immediate deletion. + RecoverableProtectedSubscription DeletionRecoveryLevel = "Recoverable+ProtectedSubscription" + // RecoverablePurgeable Soft-delete is enabled for this vault; A privileged user may trigger an immediate, + // irreversible deletion(purge) of a deleted entity. + RecoverablePurgeable DeletionRecoveryLevel = "Recoverable+Purgeable" +) + +// PossibleDeletionRecoveryLevelValues returns an array of possible values for the DeletionRecoveryLevel const type. +func PossibleDeletionRecoveryLevelValues() []DeletionRecoveryLevel { + return []DeletionRecoveryLevel{Purgeable, Recoverable, RecoverableProtectedSubscription, RecoverablePurgeable} +} + +// JSONWebKeyCurveName enumerates the values for json web key curve name. +type JSONWebKeyCurveName string + +const ( + // P256 The NIST P-256 elliptic curve, AKA SECG curve SECP256R1. + P256 JSONWebKeyCurveName = "P-256" + // P384 The NIST P-384 elliptic curve, AKA SECG curve SECP384R1. + P384 JSONWebKeyCurveName = "P-384" + // P521 The NIST P-521 elliptic curve, AKA SECG curve SECP521R1. + P521 JSONWebKeyCurveName = "P-521" + // SECP256K1 The SECG SECP256K1 elliptic curve. + SECP256K1 JSONWebKeyCurveName = "SECP256K1" +) + +// PossibleJSONWebKeyCurveNameValues returns an array of possible values for the JSONWebKeyCurveName const type. +func PossibleJSONWebKeyCurveNameValues() []JSONWebKeyCurveName { + return []JSONWebKeyCurveName{P256, P384, P521, SECP256K1} +} + +// JSONWebKeyEncryptionAlgorithm enumerates the values for json web key encryption algorithm. +type JSONWebKeyEncryptionAlgorithm string + +const ( + // RSA15 ... + RSA15 JSONWebKeyEncryptionAlgorithm = "RSA1_5" + // RSAOAEP ... + RSAOAEP JSONWebKeyEncryptionAlgorithm = "RSA-OAEP" + // RSAOAEP256 ... + RSAOAEP256 JSONWebKeyEncryptionAlgorithm = "RSA-OAEP-256" +) + +// PossibleJSONWebKeyEncryptionAlgorithmValues returns an array of possible values for the JSONWebKeyEncryptionAlgorithm const type. +func PossibleJSONWebKeyEncryptionAlgorithmValues() []JSONWebKeyEncryptionAlgorithm { + return []JSONWebKeyEncryptionAlgorithm{RSA15, RSAOAEP, RSAOAEP256} +} + +// JSONWebKeyOperation enumerates the values for json web key operation. +type JSONWebKeyOperation string + +const ( + // Decrypt ... + Decrypt JSONWebKeyOperation = "decrypt" + // Encrypt ... + Encrypt JSONWebKeyOperation = "encrypt" + // Sign ... + Sign JSONWebKeyOperation = "sign" + // UnwrapKey ... + UnwrapKey JSONWebKeyOperation = "unwrapKey" + // Verify ... + Verify JSONWebKeyOperation = "verify" + // WrapKey ... + WrapKey JSONWebKeyOperation = "wrapKey" +) + +// PossibleJSONWebKeyOperationValues returns an array of possible values for the JSONWebKeyOperation const type. +func PossibleJSONWebKeyOperationValues() []JSONWebKeyOperation { + return []JSONWebKeyOperation{Decrypt, Encrypt, Sign, UnwrapKey, Verify, WrapKey} +} + +// JSONWebKeySignatureAlgorithm enumerates the values for json web key signature algorithm. +type JSONWebKeySignatureAlgorithm string + +const ( + // ECDSA256 ... + ECDSA256 JSONWebKeySignatureAlgorithm = "ECDSA256" + // ES256 ... + ES256 JSONWebKeySignatureAlgorithm = "ES256" + // ES384 ... + ES384 JSONWebKeySignatureAlgorithm = "ES384" + // ES512 ... + ES512 JSONWebKeySignatureAlgorithm = "ES512" + // PS256 ... + PS256 JSONWebKeySignatureAlgorithm = "PS256" + // PS384 ... + PS384 JSONWebKeySignatureAlgorithm = "PS384" + // PS512 ... + PS512 JSONWebKeySignatureAlgorithm = "PS512" + // RS256 ... + RS256 JSONWebKeySignatureAlgorithm = "RS256" + // RS384 ... + RS384 JSONWebKeySignatureAlgorithm = "RS384" + // RS512 ... + RS512 JSONWebKeySignatureAlgorithm = "RS512" + // RSNULL ... + RSNULL JSONWebKeySignatureAlgorithm = "RSNULL" +) + +// PossibleJSONWebKeySignatureAlgorithmValues returns an array of possible values for the JSONWebKeySignatureAlgorithm const type. +func PossibleJSONWebKeySignatureAlgorithmValues() []JSONWebKeySignatureAlgorithm { + return []JSONWebKeySignatureAlgorithm{ECDSA256, ES256, ES384, ES512, PS256, PS384, PS512, RS256, RS384, RS512, RSNULL} +} + +// JSONWebKeyType enumerates the values for json web key type. +type JSONWebKeyType string + +const ( + // EC ... + EC JSONWebKeyType = "EC" + // ECHSM ... + ECHSM JSONWebKeyType = "EC-HSM" + // Oct ... + Oct JSONWebKeyType = "oct" + // RSA ... + RSA JSONWebKeyType = "RSA" + // RSAHSM ... + RSAHSM JSONWebKeyType = "RSA-HSM" +) + +// PossibleJSONWebKeyTypeValues returns an array of possible values for the JSONWebKeyType const type. +func PossibleJSONWebKeyTypeValues() []JSONWebKeyType { + return []JSONWebKeyType{EC, ECHSM, Oct, RSA, RSAHSM} +} + +// KeyUsageType enumerates the values for key usage type. +type KeyUsageType string + +const ( + // CRLSign ... + CRLSign KeyUsageType = "cRLSign" + // DataEncipherment ... + DataEncipherment KeyUsageType = "dataEncipherment" + // DecipherOnly ... + DecipherOnly KeyUsageType = "decipherOnly" + // DigitalSignature ... + DigitalSignature KeyUsageType = "digitalSignature" + // EncipherOnly ... + EncipherOnly KeyUsageType = "encipherOnly" + // KeyAgreement ... + KeyAgreement KeyUsageType = "keyAgreement" + // KeyCertSign ... + KeyCertSign KeyUsageType = "keyCertSign" + // KeyEncipherment ... + KeyEncipherment KeyUsageType = "keyEncipherment" + // NonRepudiation ... + NonRepudiation KeyUsageType = "nonRepudiation" +) + +// PossibleKeyUsageTypeValues returns an array of possible values for the KeyUsageType const type. +func PossibleKeyUsageTypeValues() []KeyUsageType { + return []KeyUsageType{CRLSign, DataEncipherment, DecipherOnly, DigitalSignature, EncipherOnly, KeyAgreement, KeyCertSign, KeyEncipherment, NonRepudiation} +} diff --git a/services/keyvault/2016-10-01/keyvault/models.go b/services/keyvault/2016-10-01/keyvault/models.go index cbfec5797c69..321303336b7d 100644 --- a/services/keyvault/2016-10-01/keyvault/models.go +++ b/services/keyvault/2016-10-01/keyvault/models.go @@ -30,186 +30,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault" -// ActionType enumerates the values for action type. -type ActionType string - -const ( - // AutoRenew ... - AutoRenew ActionType = "AutoRenew" - // EmailContacts ... - EmailContacts ActionType = "EmailContacts" -) - -// PossibleActionTypeValues returns an array of possible values for the ActionType const type. -func PossibleActionTypeValues() []ActionType { - return []ActionType{AutoRenew, EmailContacts} -} - -// DeletionRecoveryLevel enumerates the values for deletion recovery level. -type DeletionRecoveryLevel string - -const ( - // Purgeable Soft-delete is not enabled for this vault. A DELETE operation results in immediate and - // irreversible data loss. - Purgeable DeletionRecoveryLevel = "Purgeable" - // Recoverable Soft-delete is enabled for this vault and purge has been disabled. A deleted entity will - // remain in this state until recovered, or the end of the retention interval. - Recoverable DeletionRecoveryLevel = "Recoverable" - // RecoverableProtectedSubscription Soft-delete is enabled for this vault, and the subscription is - // protected against immediate deletion. - RecoverableProtectedSubscription DeletionRecoveryLevel = "Recoverable+ProtectedSubscription" - // RecoverablePurgeable Soft-delete is enabled for this vault; A privileged user may trigger an immediate, - // irreversible deletion(purge) of a deleted entity. - RecoverablePurgeable DeletionRecoveryLevel = "Recoverable+Purgeable" -) - -// PossibleDeletionRecoveryLevelValues returns an array of possible values for the DeletionRecoveryLevel const type. -func PossibleDeletionRecoveryLevelValues() []DeletionRecoveryLevel { - return []DeletionRecoveryLevel{Purgeable, Recoverable, RecoverableProtectedSubscription, RecoverablePurgeable} -} - -// JSONWebKeyCurveName enumerates the values for json web key curve name. -type JSONWebKeyCurveName string - -const ( - // P256 The NIST P-256 elliptic curve, AKA SECG curve SECP256R1. - P256 JSONWebKeyCurveName = "P-256" - // P384 The NIST P-384 elliptic curve, AKA SECG curve SECP384R1. - P384 JSONWebKeyCurveName = "P-384" - // P521 The NIST P-521 elliptic curve, AKA SECG curve SECP521R1. - P521 JSONWebKeyCurveName = "P-521" - // SECP256K1 The SECG SECP256K1 elliptic curve. - SECP256K1 JSONWebKeyCurveName = "SECP256K1" -) - -// PossibleJSONWebKeyCurveNameValues returns an array of possible values for the JSONWebKeyCurveName const type. -func PossibleJSONWebKeyCurveNameValues() []JSONWebKeyCurveName { - return []JSONWebKeyCurveName{P256, P384, P521, SECP256K1} -} - -// JSONWebKeyEncryptionAlgorithm enumerates the values for json web key encryption algorithm. -type JSONWebKeyEncryptionAlgorithm string - -const ( - // RSA15 ... - RSA15 JSONWebKeyEncryptionAlgorithm = "RSA1_5" - // RSAOAEP ... - RSAOAEP JSONWebKeyEncryptionAlgorithm = "RSA-OAEP" - // RSAOAEP256 ... - RSAOAEP256 JSONWebKeyEncryptionAlgorithm = "RSA-OAEP-256" -) - -// PossibleJSONWebKeyEncryptionAlgorithmValues returns an array of possible values for the JSONWebKeyEncryptionAlgorithm const type. -func PossibleJSONWebKeyEncryptionAlgorithmValues() []JSONWebKeyEncryptionAlgorithm { - return []JSONWebKeyEncryptionAlgorithm{RSA15, RSAOAEP, RSAOAEP256} -} - -// JSONWebKeyOperation enumerates the values for json web key operation. -type JSONWebKeyOperation string - -const ( - // Decrypt ... - Decrypt JSONWebKeyOperation = "decrypt" - // Encrypt ... - Encrypt JSONWebKeyOperation = "encrypt" - // Sign ... - Sign JSONWebKeyOperation = "sign" - // UnwrapKey ... - UnwrapKey JSONWebKeyOperation = "unwrapKey" - // Verify ... - Verify JSONWebKeyOperation = "verify" - // WrapKey ... - WrapKey JSONWebKeyOperation = "wrapKey" -) - -// PossibleJSONWebKeyOperationValues returns an array of possible values for the JSONWebKeyOperation const type. -func PossibleJSONWebKeyOperationValues() []JSONWebKeyOperation { - return []JSONWebKeyOperation{Decrypt, Encrypt, Sign, UnwrapKey, Verify, WrapKey} -} - -// JSONWebKeySignatureAlgorithm enumerates the values for json web key signature algorithm. -type JSONWebKeySignatureAlgorithm string - -const ( - // ECDSA256 ... - ECDSA256 JSONWebKeySignatureAlgorithm = "ECDSA256" - // ES256 ... - ES256 JSONWebKeySignatureAlgorithm = "ES256" - // ES384 ... - ES384 JSONWebKeySignatureAlgorithm = "ES384" - // ES512 ... - ES512 JSONWebKeySignatureAlgorithm = "ES512" - // PS256 ... - PS256 JSONWebKeySignatureAlgorithm = "PS256" - // PS384 ... - PS384 JSONWebKeySignatureAlgorithm = "PS384" - // PS512 ... - PS512 JSONWebKeySignatureAlgorithm = "PS512" - // RS256 ... - RS256 JSONWebKeySignatureAlgorithm = "RS256" - // RS384 ... - RS384 JSONWebKeySignatureAlgorithm = "RS384" - // RS512 ... - RS512 JSONWebKeySignatureAlgorithm = "RS512" - // RSNULL ... - RSNULL JSONWebKeySignatureAlgorithm = "RSNULL" -) - -// PossibleJSONWebKeySignatureAlgorithmValues returns an array of possible values for the JSONWebKeySignatureAlgorithm const type. -func PossibleJSONWebKeySignatureAlgorithmValues() []JSONWebKeySignatureAlgorithm { - return []JSONWebKeySignatureAlgorithm{ECDSA256, ES256, ES384, ES512, PS256, PS384, PS512, RS256, RS384, RS512, RSNULL} -} - -// JSONWebKeyType enumerates the values for json web key type. -type JSONWebKeyType string - -const ( - // EC ... - EC JSONWebKeyType = "EC" - // ECHSM ... - ECHSM JSONWebKeyType = "EC-HSM" - // Oct ... - Oct JSONWebKeyType = "oct" - // RSA ... - RSA JSONWebKeyType = "RSA" - // RSAHSM ... - RSAHSM JSONWebKeyType = "RSA-HSM" -) - -// PossibleJSONWebKeyTypeValues returns an array of possible values for the JSONWebKeyType const type. -func PossibleJSONWebKeyTypeValues() []JSONWebKeyType { - return []JSONWebKeyType{EC, ECHSM, Oct, RSA, RSAHSM} -} - -// KeyUsageType enumerates the values for key usage type. -type KeyUsageType string - -const ( - // CRLSign ... - CRLSign KeyUsageType = "cRLSign" - // DataEncipherment ... - DataEncipherment KeyUsageType = "dataEncipherment" - // DecipherOnly ... - DecipherOnly KeyUsageType = "decipherOnly" - // DigitalSignature ... - DigitalSignature KeyUsageType = "digitalSignature" - // EncipherOnly ... - EncipherOnly KeyUsageType = "encipherOnly" - // KeyAgreement ... - KeyAgreement KeyUsageType = "keyAgreement" - // KeyCertSign ... - KeyCertSign KeyUsageType = "keyCertSign" - // KeyEncipherment ... - KeyEncipherment KeyUsageType = "keyEncipherment" - // NonRepudiation ... - NonRepudiation KeyUsageType = "nonRepudiation" -) - -// PossibleKeyUsageTypeValues returns an array of possible values for the KeyUsageType const type. -func PossibleKeyUsageTypeValues() []KeyUsageType { - return []KeyUsageType{CRLSign, DataEncipherment, DecipherOnly, DigitalSignature, EncipherOnly, KeyAgreement, KeyCertSign, KeyEncipherment, NonRepudiation} -} - // Action the action that will be executed. type Action struct { // ActionType - The type of the action. Possible values include: 'EmailContacts', 'AutoRenew' @@ -242,6 +62,21 @@ type Attributes struct { Updated *date.UnixTime `json:"updated,omitempty"` } +// MarshalJSON is the custom marshaler for Attributes. +func (a Attributes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.Enabled != nil { + objectMap["enabled"] = a.Enabled + } + if a.NotBefore != nil { + objectMap["nbf"] = a.NotBefore + } + if a.Expires != nil { + objectMap["exp"] = a.Expires + } + return json.Marshal(objectMap) +} + // BackupKeyResult the backup key result, containing the backup blob. type BackupKeyResult struct { autorest.Response `json:"-"` @@ -272,6 +107,21 @@ type CertificateAttributes struct { Updated *date.UnixTime `json:"updated,omitempty"` } +// MarshalJSON is the custom marshaler for CertificateAttributes. +func (ca CertificateAttributes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ca.Enabled != nil { + objectMap["enabled"] = ca.Enabled + } + if ca.NotBefore != nil { + objectMap["nbf"] = ca.NotBefore + } + if ca.Expires != nil { + objectMap["exp"] = ca.Expires + } + return json.Marshal(objectMap) +} + // CertificateBundle a certificate bundle consists of a certificate (X509) plus its attributes. type CertificateBundle struct { autorest.Response `json:"-"` @@ -459,10 +309,15 @@ func (cilr CertificateIssuerListResult) IsEmpty() bool { return cilr.Value == nil || len(*cilr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (cilr CertificateIssuerListResult) hasNextLink() bool { + return cilr.NextLink != nil && len(*cilr.NextLink) != 0 +} + // certificateIssuerListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (cilr CertificateIssuerListResult) certificateIssuerListResultPreparer(ctx context.Context) (*http.Request, error) { - if cilr.NextLink == nil || len(to.String(cilr.NextLink)) < 1 { + if !cilr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -490,11 +345,16 @@ func (page *CertificateIssuerListResultPage) NextWithContext(ctx context.Context tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.cilr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.cilr) + if err != nil { + return err + } + page.cilr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.cilr = next return nil } @@ -524,8 +384,11 @@ func (page CertificateIssuerListResultPage) Values() []CertificateIssuerItem { } // Creates a new instance of the CertificateIssuerListResultPage type. -func NewCertificateIssuerListResultPage(getNextPage func(context.Context, CertificateIssuerListResult) (CertificateIssuerListResult, error)) CertificateIssuerListResultPage { - return CertificateIssuerListResultPage{fn: getNextPage} +func NewCertificateIssuerListResultPage(cur CertificateIssuerListResult, getNextPage func(context.Context, CertificateIssuerListResult) (CertificateIssuerListResult, error)) CertificateIssuerListResultPage { + return CertificateIssuerListResultPage{ + fn: getNextPage, + cilr: cur, + } } // CertificateIssuerSetParameters the certificate issuer set parameters. @@ -659,10 +522,15 @@ func (clr CertificateListResult) IsEmpty() bool { return clr.Value == nil || len(*clr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (clr CertificateListResult) hasNextLink() bool { + return clr.NextLink != nil && len(*clr.NextLink) != 0 +} + // certificateListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (clr CertificateListResult) certificateListResultPreparer(ctx context.Context) (*http.Request, error) { - if clr.NextLink == nil || len(to.String(clr.NextLink)) < 1 { + if !clr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -690,11 +558,16 @@ func (page *CertificateListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.clr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.clr) + if err != nil { + return err + } + page.clr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.clr = next return nil } @@ -724,8 +597,11 @@ func (page CertificateListResultPage) Values() []CertificateItem { } // Creates a new instance of the CertificateListResultPage type. -func NewCertificateListResultPage(getNextPage func(context.Context, CertificateListResult) (CertificateListResult, error)) CertificateListResultPage { - return CertificateListResultPage{fn: getNextPage} +func NewCertificateListResultPage(cur CertificateListResult, getNextPage func(context.Context, CertificateListResult) (CertificateListResult, error)) CertificateListResultPage { + return CertificateListResultPage{ + fn: getNextPage, + clr: cur, + } } // CertificateMergeParameters the certificate merge parameters @@ -776,6 +652,36 @@ type CertificateOperation struct { RequestID *string `json:"request_id,omitempty"` } +// MarshalJSON is the custom marshaler for CertificateOperation. +func (co CertificateOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if co.IssuerParameters != nil { + objectMap["issuer"] = co.IssuerParameters + } + if co.Csr != nil { + objectMap["csr"] = co.Csr + } + if co.CancellationRequested != nil { + objectMap["cancellation_requested"] = co.CancellationRequested + } + if co.Status != nil { + objectMap["status"] = co.Status + } + if co.StatusDetails != nil { + objectMap["status_details"] = co.StatusDetails + } + if co.Error != nil { + objectMap["error"] = co.Error + } + if co.Target != nil { + objectMap["target"] = co.Target + } + if co.RequestID != nil { + objectMap["request_id"] = co.RequestID + } + return json.Marshal(objectMap) +} + // CertificateOperationUpdateParameter the certificate operation update parameters. type CertificateOperationUpdateParameter struct { // CancellationRequested - Indicates if cancellation was requested on the certificate operation. @@ -801,6 +707,30 @@ type CertificatePolicy struct { Attributes *CertificateAttributes `json:"attributes,omitempty"` } +// MarshalJSON is the custom marshaler for CertificatePolicy. +func (cp CertificatePolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.KeyProperties != nil { + objectMap["key_props"] = cp.KeyProperties + } + if cp.SecretProperties != nil { + objectMap["secret_props"] = cp.SecretProperties + } + if cp.X509CertificateProperties != nil { + objectMap["x509_props"] = cp.X509CertificateProperties + } + if cp.LifetimeActions != nil { + objectMap["lifetime_actions"] = cp.LifetimeActions + } + if cp.IssuerParameters != nil { + objectMap["issuer"] = cp.IssuerParameters + } + if cp.Attributes != nil { + objectMap["attributes"] = cp.Attributes + } + return json.Marshal(objectMap) +} + // CertificateUpdateParameters the certificate update parameters. type CertificateUpdateParameters struct { // CertificatePolicy - The management policy for the certificate. @@ -845,6 +775,15 @@ type Contacts struct { ContactList *[]Contact `json:"contacts,omitempty"` } +// MarshalJSON is the custom marshaler for Contacts. +func (c Contacts) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ContactList != nil { + objectMap["contacts"] = c.ContactList + } + return json.Marshal(objectMap) +} + // DeletedCertificateBundle a Deleted Certificate consisting of its previous id, attributes and its tags, // as well as information on when it will be purged. type DeletedCertificateBundle struct { @@ -1013,10 +952,15 @@ func (dclr DeletedCertificateListResult) IsEmpty() bool { return dclr.Value == nil || len(*dclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dclr DeletedCertificateListResult) hasNextLink() bool { + return dclr.NextLink != nil && len(*dclr.NextLink) != 0 +} + // deletedCertificateListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dclr DeletedCertificateListResult) deletedCertificateListResultPreparer(ctx context.Context) (*http.Request, error) { - if dclr.NextLink == nil || len(to.String(dclr.NextLink)) < 1 { + if !dclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1044,11 +988,16 @@ func (page *DeletedCertificateListResultPage) NextWithContext(ctx context.Contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dclr) + if err != nil { + return err + } + page.dclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dclr = next return nil } @@ -1078,8 +1027,11 @@ func (page DeletedCertificateListResultPage) Values() []DeletedCertificateItem { } // Creates a new instance of the DeletedCertificateListResultPage type. -func NewDeletedCertificateListResultPage(getNextPage func(context.Context, DeletedCertificateListResult) (DeletedCertificateListResult, error)) DeletedCertificateListResultPage { - return DeletedCertificateListResultPage{fn: getNextPage} +func NewDeletedCertificateListResultPage(cur DeletedCertificateListResult, getNextPage func(context.Context, DeletedCertificateListResult) (DeletedCertificateListResult, error)) DeletedCertificateListResultPage { + return DeletedCertificateListResultPage{ + fn: getNextPage, + dclr: cur, + } } // DeletedKeyBundle a DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info @@ -1232,10 +1184,15 @@ func (dklr DeletedKeyListResult) IsEmpty() bool { return dklr.Value == nil || len(*dklr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dklr DeletedKeyListResult) hasNextLink() bool { + return dklr.NextLink != nil && len(*dklr.NextLink) != 0 +} + // deletedKeyListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dklr DeletedKeyListResult) deletedKeyListResultPreparer(ctx context.Context) (*http.Request, error) { - if dklr.NextLink == nil || len(to.String(dklr.NextLink)) < 1 { + if !dklr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1263,11 +1220,16 @@ func (page *DeletedKeyListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dklr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dklr) + if err != nil { + return err + } + page.dklr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dklr = next return nil } @@ -1297,8 +1259,11 @@ func (page DeletedKeyListResultPage) Values() []DeletedKeyItem { } // Creates a new instance of the DeletedKeyListResultPage type. -func NewDeletedKeyListResultPage(getNextPage func(context.Context, DeletedKeyListResult) (DeletedKeyListResult, error)) DeletedKeyListResultPage { - return DeletedKeyListResultPage{fn: getNextPage} +func NewDeletedKeyListResultPage(cur DeletedKeyListResult, getNextPage func(context.Context, DeletedKeyListResult) (DeletedKeyListResult, error)) DeletedKeyListResultPage { + return DeletedKeyListResultPage{ + fn: getNextPage, + dklr: cur, + } } // DeletedSecretBundle a Deleted Secret consisting of its previous id, attributes and its tags, as well as @@ -1469,10 +1434,15 @@ func (dslr DeletedSecretListResult) IsEmpty() bool { return dslr.Value == nil || len(*dslr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dslr DeletedSecretListResult) hasNextLink() bool { + return dslr.NextLink != nil && len(*dslr.NextLink) != 0 +} + // deletedSecretListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dslr DeletedSecretListResult) deletedSecretListResultPreparer(ctx context.Context) (*http.Request, error) { - if dslr.NextLink == nil || len(to.String(dslr.NextLink)) < 1 { + if !dslr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1500,11 +1470,16 @@ func (page *DeletedSecretListResultPage) NextWithContext(ctx context.Context) (e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dslr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dslr) + if err != nil { + return err + } + page.dslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dslr = next return nil } @@ -1534,8 +1509,11 @@ func (page DeletedSecretListResultPage) Values() []DeletedSecretItem { } // Creates a new instance of the DeletedSecretListResultPage type. -func NewDeletedSecretListResultPage(getNextPage func(context.Context, DeletedSecretListResult) (DeletedSecretListResult, error)) DeletedSecretListResultPage { - return DeletedSecretListResultPage{fn: getNextPage} +func NewDeletedSecretListResultPage(cur DeletedSecretListResult, getNextPage func(context.Context, DeletedSecretListResult) (DeletedSecretListResult, error)) DeletedSecretListResultPage { + return DeletedSecretListResultPage{ + fn: getNextPage, + dslr: cur, + } } // Error the key vault server error. @@ -1564,6 +1542,15 @@ type IssuerAttributes struct { Updated *date.UnixTime `json:"updated,omitempty"` } +// MarshalJSON is the custom marshaler for IssuerAttributes. +func (ia IssuerAttributes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ia.Enabled != nil { + objectMap["enabled"] = ia.Enabled + } + return json.Marshal(objectMap) +} + // IssuerBundle the issuer for Key Vault certificate. type IssuerBundle struct { autorest.Response `json:"-"` @@ -1579,6 +1566,24 @@ type IssuerBundle struct { Attributes *IssuerAttributes `json:"attributes,omitempty"` } +// MarshalJSON is the custom marshaler for IssuerBundle. +func (ib IssuerBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ib.Provider != nil { + objectMap["provider"] = ib.Provider + } + if ib.Credentials != nil { + objectMap["credentials"] = ib.Credentials + } + if ib.OrganizationDetails != nil { + objectMap["org_details"] = ib.OrganizationDetails + } + if ib.Attributes != nil { + objectMap["attributes"] = ib.Attributes + } + return json.Marshal(objectMap) +} + // IssuerCredentials the credentials to be used for the certificate issuer. type IssuerCredentials struct { // AccountID - The user name/account name/account id. @@ -1646,6 +1651,21 @@ type KeyAttributes struct { Updated *date.UnixTime `json:"updated,omitempty"` } +// MarshalJSON is the custom marshaler for KeyAttributes. +func (ka KeyAttributes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ka.Enabled != nil { + objectMap["enabled"] = ka.Enabled + } + if ka.NotBefore != nil { + objectMap["nbf"] = ka.NotBefore + } + if ka.Expires != nil { + objectMap["exp"] = ka.Expires + } + return json.Marshal(objectMap) +} + // KeyBundle a KeyBundle consisting of a WebKey plus its attributes. type KeyBundle struct { autorest.Response `json:"-"` @@ -1846,10 +1866,15 @@ func (klr KeyListResult) IsEmpty() bool { return klr.Value == nil || len(*klr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (klr KeyListResult) hasNextLink() bool { + return klr.NextLink != nil && len(*klr.NextLink) != 0 +} + // keyListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (klr KeyListResult) keyListResultPreparer(ctx context.Context) (*http.Request, error) { - if klr.NextLink == nil || len(to.String(klr.NextLink)) < 1 { + if !klr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1877,11 +1902,16 @@ func (page *KeyListResultPage) NextWithContext(ctx context.Context) (err error) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.klr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.klr) + if err != nil { + return err + } + page.klr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.klr = next return nil } @@ -1911,8 +1941,11 @@ func (page KeyListResultPage) Values() []KeyItem { } // Creates a new instance of the KeyListResultPage type. -func NewKeyListResultPage(getNextPage func(context.Context, KeyListResult) (KeyListResult, error)) KeyListResultPage { - return KeyListResultPage{fn: getNextPage} +func NewKeyListResultPage(cur KeyListResult, getNextPage func(context.Context, KeyListResult) (KeyListResult, error)) KeyListResultPage { + return KeyListResultPage{ + fn: getNextPage, + klr: cur, + } } // KeyOperationResult the key operation result. @@ -2032,6 +2065,15 @@ type SasDefinitionAttributes struct { Updated *date.UnixTime `json:"updated,omitempty"` } +// MarshalJSON is the custom marshaler for SasDefinitionAttributes. +func (sda SasDefinitionAttributes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sda.Enabled != nil { + objectMap["enabled"] = sda.Enabled + } + return json.Marshal(objectMap) +} + // SasDefinitionBundle a SAS definition bundle consists of key vault SAS definition details plus its // attributes. type SasDefinitionBundle struct { @@ -2174,10 +2216,15 @@ func (sdlr SasDefinitionListResult) IsEmpty() bool { return sdlr.Value == nil || len(*sdlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (sdlr SasDefinitionListResult) hasNextLink() bool { + return sdlr.NextLink != nil && len(*sdlr.NextLink) != 0 +} + // sasDefinitionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (sdlr SasDefinitionListResult) sasDefinitionListResultPreparer(ctx context.Context) (*http.Request, error) { - if sdlr.NextLink == nil || len(to.String(sdlr.NextLink)) < 1 { + if !sdlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2205,11 +2252,16 @@ func (page *SasDefinitionListResultPage) NextWithContext(ctx context.Context) (e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.sdlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.sdlr) + if err != nil { + return err + } + page.sdlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.sdlr = next return nil } @@ -2239,8 +2291,11 @@ func (page SasDefinitionListResultPage) Values() []SasDefinitionItem { } // Creates a new instance of the SasDefinitionListResultPage type. -func NewSasDefinitionListResultPage(getNextPage func(context.Context, SasDefinitionListResult) (SasDefinitionListResult, error)) SasDefinitionListResultPage { - return SasDefinitionListResultPage{fn: getNextPage} +func NewSasDefinitionListResultPage(cur SasDefinitionListResult, getNextPage func(context.Context, SasDefinitionListResult) (SasDefinitionListResult, error)) SasDefinitionListResultPage { + return SasDefinitionListResultPage{ + fn: getNextPage, + sdlr: cur, + } } // SasDefinitionUpdateParameters the SAS definition update parameters. @@ -2284,6 +2339,21 @@ type SecretAttributes struct { Updated *date.UnixTime `json:"updated,omitempty"` } +// MarshalJSON is the custom marshaler for SecretAttributes. +func (sa SecretAttributes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sa.Enabled != nil { + objectMap["enabled"] = sa.Enabled + } + if sa.NotBefore != nil { + objectMap["nbf"] = sa.NotBefore + } + if sa.Expires != nil { + objectMap["exp"] = sa.Expires + } + return json.Marshal(objectMap) +} + // SecretBundle a secret consisting of a value, id and its attributes. type SecretBundle struct { autorest.Response `json:"-"` @@ -2433,10 +2503,15 @@ func (slr SecretListResult) IsEmpty() bool { return slr.Value == nil || len(*slr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (slr SecretListResult) hasNextLink() bool { + return slr.NextLink != nil && len(*slr.NextLink) != 0 +} + // secretListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (slr SecretListResult) secretListResultPreparer(ctx context.Context) (*http.Request, error) { - if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { + if !slr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2464,11 +2539,16 @@ func (page *SecretListResultPage) NextWithContext(ctx context.Context) (err erro tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.slr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.slr) + if err != nil { + return err + } + page.slr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.slr = next return nil } @@ -2498,8 +2578,11 @@ func (page SecretListResultPage) Values() []SecretItem { } // Creates a new instance of the SecretListResultPage type. -func NewSecretListResultPage(getNextPage func(context.Context, SecretListResult) (SecretListResult, error)) SecretListResultPage { - return SecretListResultPage{fn: getNextPage} +func NewSecretListResultPage(cur SecretListResult, getNextPage func(context.Context, SecretListResult) (SecretListResult, error)) SecretListResultPage { + return SecretListResultPage{ + fn: getNextPage, + slr: cur, + } } // SecretProperties properties of the key backing a certificate. @@ -2579,6 +2662,15 @@ type StorageAccountAttributes struct { Updated *date.UnixTime `json:"updated,omitempty"` } +// MarshalJSON is the custom marshaler for StorageAccountAttributes. +func (saa StorageAccountAttributes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if saa.Enabled != nil { + objectMap["enabled"] = saa.Enabled + } + return json.Marshal(objectMap) +} + // StorageAccountCreateParameters the storage account create parameters. type StorageAccountCreateParameters struct { // ResourceID - Storage account resource id. @@ -2781,10 +2873,15 @@ func (slr StorageListResult) IsEmpty() bool { return slr.Value == nil || len(*slr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (slr StorageListResult) hasNextLink() bool { + return slr.NextLink != nil && len(*slr.NextLink) != 0 +} + // storageListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (slr StorageListResult) storageListResultPreparer(ctx context.Context) (*http.Request, error) { - if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { + if !slr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2812,11 +2909,16 @@ func (page *StorageListResultPage) NextWithContext(ctx context.Context) (err err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.slr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.slr) + if err != nil { + return err + } + page.slr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.slr = next return nil } @@ -2846,8 +2948,11 @@ func (page StorageListResultPage) Values() []StorageAccountItem { } // Creates a new instance of the StorageListResultPage type. -func NewStorageListResultPage(getNextPage func(context.Context, StorageListResult) (StorageListResult, error)) StorageListResultPage { - return StorageListResultPage{fn: getNextPage} +func NewStorageListResultPage(cur StorageListResult, getNextPage func(context.Context, StorageListResult) (StorageListResult, error)) StorageListResultPage { + return StorageListResultPage{ + fn: getNextPage, + slr: cur, + } } // SubjectAlternativeNames the subject alternate names of a X509 object. diff --git a/services/keyvault/2016-10-01/keyvault/version.go b/services/keyvault/2016-10-01/keyvault/version.go index fb6a25c73006..b63082f340ad 100644 --- a/services/keyvault/2016-10-01/keyvault/version.go +++ b/services/keyvault/2016-10-01/keyvault/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " keyvault/2016-10-01" + return "Azure-SDK-For-Go/" + Version() + " keyvault/2016-10-01" } // Version returns the semantic version (see http://semver.org) of the client.